multi: change NewBitcoindBackend to take a miner as its param

Prepares for the following commit where we assert the chain backend is
synced to the miner.
This commit is contained in:
yyforyongyu
2025-02-25 21:33:16 +08:00
parent c725ba9f25
commit 99d49dec6a
5 changed files with 22 additions and 25 deletions

View File

@@ -83,7 +83,7 @@ func NewMiner(t *testing.T, netParams *chaincfg.Params, extraArgs []string,
// used for block and tx notifications or if its ZMQ interface should be used.
// A connection to the newly spawned bitcoind node is returned.
func NewBitcoindBackend(t *testing.T, netParams *chaincfg.Params,
minerAddr string, txindex, rpcpolling bool) *chain.BitcoindConn {
miner *rpctest.Harness, txindex, rpcpolling bool) *chain.BitcoindConn {
t.Helper()
@@ -204,7 +204,7 @@ func NewBitcoindBackend(t *testing.T, netParams *chaincfg.Params,
require.NoError(t, err, "failed to create RPC client")
// Connect to the miner node.
err = rpcClient.AddNode(minerAddr, rpcclient.ANAdd)
err = rpcClient.AddNode(miner.P2PAddress(), rpcclient.ANAdd)
require.NoError(t, err, "failed to connect to miner")
// Get the network info and assert the num of outbound connections is 1.