build: update btcd and btcwallet dependencies

This commit is contained in:
Wilmer Paulino
2021-03-09 14:12:26 -08:00
parent a329c80612
commit a620ce3682
25 changed files with 327 additions and 317 deletions

View File

@@ -63,7 +63,7 @@ func waitForMempoolTx(r *rpctest.Harness, txid *chainhash.Hash) error {
time.Sleep(100 * time.Millisecond)
// Check for the harness' knowledge of the txid
tx, err = r.Node.GetRawTransaction(txid)
tx, err = r.Client.GetRawTransaction(txid)
if err != nil {
switch e := err.(type) {
case *btcjson.RPCError:
@@ -188,12 +188,12 @@ func testFilterBlockNotifications(node *rpctest.Harness,
blockChan := chainView.FilteredBlocks()
// Next we'll mine a block confirming the output generated above.
newBlockHashes, err := node.Node.Generate(1)
newBlockHashes, err := node.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate block: %v", err)
}
_, currentHeight, err := node.Node.GetBestBlock()
_, currentHeight, err := node.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -211,11 +211,11 @@ func testFilterBlockNotifications(node *rpctest.Harness,
// Now that the block has been mined, we'll fetch the two transactions
// so we can add them to the filter, and also craft transaction
// spending the outputs we created.
tx1, err := node.Node.GetRawTransaction(txid1)
tx1, err := node.Client.GetRawTransaction(txid1)
if err != nil {
t.Fatalf("unable to fetch transaction: %v", err)
}
tx2, err := node.Node.GetRawTransaction(txid2)
tx2, err := node.Client.GetRawTransaction(txid2)
if err != nil {
t.Fatalf("unable to fetch transaction: %v", err)
}
@@ -236,7 +236,7 @@ func testFilterBlockNotifications(node *rpctest.Harness,
t.Fatalf("unable to find output: %v", err)
}
_, currentHeight, err = node.Node.GetBestBlock()
_, currentHeight, err = node.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -264,7 +264,7 @@ func testFilterBlockNotifications(node *rpctest.Harness,
// Now we'll broadcast the first spending transaction and also mine a
// block which should include it.
spendTxid1, err := node.Node.SendRawTransaction(spendingTx1, true)
spendTxid1, err := node.Client.SendRawTransaction(spendingTx1, true)
if err != nil {
t.Fatalf("unable to broadcast transaction: %v", err)
}
@@ -272,7 +272,7 @@ func testFilterBlockNotifications(node *rpctest.Harness,
if err != nil {
t.Fatalf("unable to get spending txid in mempool: %v", err)
}
newBlockHashes, err = node.Node.Generate(1)
newBlockHashes, err = node.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate block: %v", err)
}
@@ -290,7 +290,7 @@ func testFilterBlockNotifications(node *rpctest.Harness,
// Next, mine the second transaction which spends the second output.
// This should also generate a notification.
spendTxid2, err := node.Node.SendRawTransaction(spendingTx2, true)
spendTxid2, err := node.Client.SendRawTransaction(spendingTx2, true)
if err != nil {
t.Fatalf("unable to broadcast transaction: %v", err)
}
@@ -298,7 +298,7 @@ func testFilterBlockNotifications(node *rpctest.Harness,
if err != nil {
t.Fatalf("unable to get spending txid in mempool: %v", err)
}
newBlockHashes, err = node.Node.Generate(1)
newBlockHashes, err = node.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate block: %v", err)
}
@@ -328,14 +328,14 @@ func testUpdateFilterBackTrack(node *rpctest.Harness,
}
// Next we'll mine a block confirming the output generated above.
initBlockHashes, err := node.Node.Generate(1)
initBlockHashes, err := node.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate block: %v", err)
}
blockChan := chainView.FilteredBlocks()
_, currentHeight, err := node.Node.GetBestBlock()
_, currentHeight, err := node.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -352,7 +352,7 @@ func testUpdateFilterBackTrack(node *rpctest.Harness,
// Next, create a transaction which spends the output created above,
// mining the spend into a block.
tx, err := node.Node.GetRawTransaction(txid)
tx, err := node.Client.GetRawTransaction(txid)
if err != nil {
t.Fatalf("unable to fetch transaction: %v", err)
}
@@ -364,7 +364,7 @@ func testUpdateFilterBackTrack(node *rpctest.Harness,
if err != nil {
t.Fatalf("unable to create spending tx: %v", err)
}
spendTxid, err := node.Node.SendRawTransaction(spendingTx, true)
spendTxid, err := node.Client.SendRawTransaction(spendingTx, true)
if err != nil {
t.Fatalf("unable to broadcast transaction: %v", err)
}
@@ -372,7 +372,7 @@ func testUpdateFilterBackTrack(node *rpctest.Harness,
if err != nil {
t.Fatalf("unable to get spending txid in mempool: %v", err)
}
newBlockHashes, err := node.Node.Generate(1)
newBlockHashes, err := node.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate block: %v", err)
}
@@ -435,12 +435,12 @@ func testFilterSingleBlock(node *rpctest.Harness, chainView FilteredChainView,
blockChan := chainView.FilteredBlocks()
// Next we'll mine a block confirming the output generated above.
newBlockHashes, err := node.Node.Generate(1)
newBlockHashes, err := node.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate block: %v", err)
}
_, currentHeight, err := node.Node.GetBestBlock()
_, currentHeight, err := node.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -455,11 +455,11 @@ func testFilterSingleBlock(node *rpctest.Harness, chainView FilteredChainView,
t.Fatalf("filtered block notification didn't arrive")
}
tx1, err := node.Node.GetRawTransaction(txid1)
tx1, err := node.Client.GetRawTransaction(txid1)
if err != nil {
t.Fatalf("unable to fetch transaction: %v", err)
}
tx2, err := node.Node.GetRawTransaction(txid2)
tx2, err := node.Client.GetRawTransaction(txid2)
if err != nil {
t.Fatalf("unable to fetch transaction: %v", err)
}
@@ -496,7 +496,7 @@ func testFilterSingleBlock(node *rpctest.Harness, chainView FilteredChainView,
t.Fatalf("filtered block notification didn't arrive")
}
_, currentHeight, err = node.Node.GetBestBlock()
_, currentHeight, err = node.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -579,7 +579,7 @@ func testFilterBlockDisconnected(node *rpctest.Harness,
time.Sleep(time.Second * 3)
}
_, oldHeight, err := reorgNode.Node.GetBestBlock()
_, oldHeight, err := reorgNode.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -595,7 +595,7 @@ func testFilterBlockDisconnected(node *rpctest.Harness,
t.Fatalf("unable to join node on blocks: %v", err)
}
_, newHeight, err := reorgNode.Node.GetBestBlock()
_, newHeight, err := reorgNode.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -635,21 +635,21 @@ func testFilterBlockDisconnected(node *rpctest.Harness,
// Now we trigger a small reorg, by disconnecting the nodes, mining
// a few blocks on each, then connecting them again.
peers, err := reorgNode.Node.GetPeerInfo()
peers, err := reorgNode.Client.GetPeerInfo()
if err != nil {
t.Fatalf("unable to get peer info: %v", err)
}
numPeers := len(peers)
// Disconnect the nodes.
err = reorgNode.Node.AddNode(node.P2PAddress(), rpcclient.ANRemove)
err = reorgNode.Client.AddNode(node.P2PAddress(), rpcclient.ANRemove)
if err != nil {
t.Fatalf("unable to disconnect mining nodes: %v", err)
}
// Wait for disconnection
for {
peers, err = reorgNode.Node.GetPeerInfo()
peers, err = reorgNode.Client.GetPeerInfo()
if err != nil {
t.Fatalf("unable to get peer info: %v", err)
}
@@ -661,8 +661,12 @@ func testFilterBlockDisconnected(node *rpctest.Harness,
// Mine 10 blocks on the main chain, 5 on the chain that will be
// reorged out,
node.Node.Generate(10)
reorgNode.Node.Generate(5)
if _, err := node.Client.Generate(10); err != nil {
t.Fatalf("unable to generate blocks on main chain: %v", err)
}
if _, err := reorgNode.Client.Generate(5); err != nil {
t.Fatalf("unable to generate blocks on reorged chain: %v", err)
}
// 5 new blocks should get notified.
for i := uint32(0); i < 5; i++ {
@@ -682,7 +686,7 @@ func testFilterBlockDisconnected(node *rpctest.Harness,
}
}
_, oldHeight, err = reorgNode.Node.GetBestBlock()
_, oldHeight, err = reorgNode.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -695,8 +699,7 @@ func testFilterBlockDisconnected(node *rpctest.Harness,
t.Fatalf("unable to join node on blocks: %v", err)
}
_, newHeight, err = reorgNode.Node.GetBestBlock()
if err != nil {
if _, _, err := reorgNode.Client.GetBestBlock(); err != nil {
t.Fatalf("unable to get current height: %v", err)
}