Skip to content

Commit

Permalink
chore: add wallet name for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Aug 16, 2024
1 parent 4b80c69 commit 02ca753
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions itest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func keyToAddr(key *btcec.PrivateKey, net *chaincfg.Params) (btcutil.Address, er
return pubKeyAddr.AddressPubKeyHash(), nil
}

func defaultStakerConfig(t *testing.T, passphrase string) (*stakercfg.Config, *rpcclient.Client) {
func defaultStakerConfig(t *testing.T, walletName, passphrase string) (*stakercfg.Config, *rpcclient.Client) {
defaultConfig := stakercfg.DefaultConfig()

// both wallet and node are bicoind
Expand All @@ -98,6 +98,7 @@ func defaultStakerConfig(t *testing.T, passphrase string) (*stakercfg.Config, *r
defaultConfig.WalletRpcConfig.Pass = bitcoindPass
defaultConfig.WalletRpcConfig.DisableTls = true
defaultConfig.WalletConfig.WalletPass = passphrase
defaultConfig.WalletConfig.WalletName = walletName

// node configuration
defaultConfig.BtcNodeBackendConfig.Bitcoind.RPCHost = bitcoindHost
Expand Down Expand Up @@ -223,7 +224,8 @@ func StartManager(
h := NewBitcoindHandler(t)
h.Start()
passphrase := "pass"
_ = h.CreateWallet("test-wallet", passphrase)
walletName := "test-wallet"
_ = h.CreateWallet(walletName, passphrase)
// only outputs which are 100 deep are mature
br := h.GenerateBlocks(int(numMatureOutputsInWallet) + 100)

Expand Down Expand Up @@ -258,7 +260,7 @@ func StartManager(
err = bh.Start()
require.NoError(t, err)

cfg, c := defaultStakerConfig(t, passphrase)
cfg, c := defaultStakerConfig(t, walletName, passphrase)

logger := logrus.New()
logger.SetLevel(logrus.DebugLevel)
Expand Down Expand Up @@ -1577,9 +1579,9 @@ func TestBitcoindWalletBip322Signing(t *testing.T) {
h := NewBitcoindHandler(t)
h.Start()
passphrase := "pass"

_ = h.CreateWallet("test-wallet", passphrase)
cfg, c := defaultStakerConfig(t, passphrase)
walletName := "test-wallet"
_ = h.CreateWallet(walletName, passphrase)
cfg, c := defaultStakerConfig(t, walletName, passphrase)

segwitAddress, err := c.GetNewAddress("")
require.NoError(t, err)
Expand Down

0 comments on commit 02ca753

Please sign in to comment.