build: update btcd and btcwallet dependencies

This commit is contained in:
Wilmer Paulino committed 2021-04-05 15:41:04 -07:00
1 parent a329c80612
commit a620ce3682
25 files changed
+327 -317

No files matched your search

+70 -70
View File
@@ -43,7 +43,7 @@ func testSingleConfirmationNotification(miner *rpctest.Harness,
t.Fatalf("tx not relayed to miner: %v", err)
}
_, currentHeight, err := miner.Node.GetBestBlock()
_, currentHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -67,7 +67,7 @@ func testSingleConfirmationNotification(miner *rpctest.Harness,
// Now generate a single block, the transaction should be included which
// should trigger a notification event.
blockHash, err := miner.Node.Generate(1)
blockHash, err := miner.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
@@ -81,7 +81,7 @@ func testSingleConfirmationNotification(miner *rpctest.Harness,
// Finally, we'll verify that the tx index returned is the exact same
// as the tx index of the transaction within the block itself.
msgBlock, err := miner.Node.GetBlock(blockHash[0])
msgBlock, err := miner.Client.GetBlock(blockHash[0])
if err != nil {
t.Fatalf("unable to fetch block: %v", err)
}
@@ -117,7 +117,7 @@ func testMultiConfirmationNotification(miner *rpctest.Harness,
t.Fatalf("tx not relayed to miner: %v", err)
}
_, currentHeight, err := miner.Node.GetBestBlock()
_, currentHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -139,7 +139,7 @@ func testMultiConfirmationNotification(miner *rpctest.Harness,
// Now generate a six blocks. The transaction should be included in the
// first block, which will be built upon by the other 5 blocks.
if _, err := miner.Node.Generate(6); err != nil {
if _, err := miner.Client.Generate(6); err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
@@ -163,7 +163,7 @@ func testBatchConfirmationNotification(miner *rpctest.Harness,
confSpread := [6]uint32{1, 2, 3, 6, 20, 22}
confIntents := make([]*chainntnfs.ConfirmationEvent, len(confSpread))
_, currentHeight, err := miner.Node.GetBestBlock()
_, currentHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -215,7 +215,7 @@ func testBatchConfirmationNotification(miner *rpctest.Harness,
// Generate the number of blocks necessary to trigger this
// current confirmation notification.
if _, err := miner.Node.Generate(blocksToGen); err != nil {
if _, err := miner.Client.Generate(blocksToGen); err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
@@ -275,7 +275,7 @@ func testSpendNotification(miner *rpctest.Harness,
// To do so, we first create a new output to our test target address.
outpoint, output, privKey := chainntnfs.CreateSpendableOutput(t, miner)
_, currentHeight, err := miner.Node.GetBestBlock()
_, currentHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -308,7 +308,7 @@ func testSpendNotification(miner *rpctest.Harness,
spendingTx := chainntnfs.CreateSpendTx(t, outpoint, output, privKey)
// Broadcast our spending transaction.
spenderSha, err := miner.Node.SendRawTransaction(spendingTx, true)
spenderSha, err := miner.Client.SendRawTransaction(spendingTx, true)
if err != nil {
t.Fatalf("unable to broadcast tx: %v", err)
}
@@ -365,11 +365,11 @@ func testSpendNotification(miner *rpctest.Harness,
// Now we mine a single block, which should include our spend. The
// notification should also be sent off.
if _, err := miner.Node.Generate(1); err != nil {
if _, err := miner.Client.Generate(1); err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
_, currentHeight, err = miner.Node.GetBestBlock()
_, currentHeight, err = miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -425,7 +425,7 @@ func testBlockEpochNotification(miner *rpctest.Harness,
// Now generate 10 blocks, the clients above should each receive 10
// notifications, thereby unblocking the goroutine above.
if _, err := miner.Node.Generate(numBlocks); err != nil {
if _, err := miner.Client.Generate(numBlocks); err != nil {
t.Fatalf("unable to generate blocks: %v", err)
}
@@ -455,7 +455,7 @@ func testMultiClientConfirmationNotification(miner *rpctest.Harness,
numConfs = 1
)
_, currentHeight, err := miner.Node.GetBestBlock()
_, currentHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -492,7 +492,7 @@ func testMultiClientConfirmationNotification(miner *rpctest.Harness,
// Finally, generate a single block which should trigger the unblocking
// of all numConfsClients blocked on the channel read above.
if _, err := miner.Node.Generate(1); err != nil {
if _, err := miner.Client.Generate(1); err != nil {
t.Fatalf("unable to generate block: %v", err)
}
@@ -525,7 +525,7 @@ func testTxConfirmedBeforeNtfnRegistration(miner *rpctest.Harness,
// older blocks when the confirmation event is registered below to ensure
// that the TXID hasn't already been included in the chain, otherwise the
// notification will never be sent.
_, err = miner.Node.Generate(1)
_, err = miner.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate block: %v", err)
}
@@ -546,13 +546,13 @@ func testTxConfirmedBeforeNtfnRegistration(miner *rpctest.Harness,
t.Fatalf("tx not relayed to miner: %v", err)
}
_, currentHeight, err := miner.Node.GetBestBlock()
_, currentHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
// Now generate another block containing txs 1 & 2.
blockHash, err := miner.Node.Generate(1)
blockHash, err := miner.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate block: %v", err)
}
@@ -579,7 +579,7 @@ func testTxConfirmedBeforeNtfnRegistration(miner *rpctest.Harness,
case confInfo := <-ntfn1.Confirmed:
// Finally, we'll verify that the tx index returned is the exact same
// as the tx index of the transaction within the block itself.
msgBlock, err := miner.Node.GetBlock(blockHash[0])
msgBlock, err := miner.Client.GetBlock(blockHash[0])
if err != nil {
t.Fatalf("unable to fetch block: %v", err)
}
@@ -622,7 +622,7 @@ func testTxConfirmedBeforeNtfnRegistration(miner *rpctest.Harness,
}
// Fully confirm tx3.
_, err = miner.Node.Generate(2)
_, err = miner.Client.Generate(2)
if err != nil {
t.Fatalf("unable to generate block: %v", err)
}
@@ -710,7 +710,7 @@ func testLazyNtfnConsumer(miner *rpctest.Harness,
t.Fatalf("tx not relayed to miner: %v", err)
}
_, currentHeight, err := miner.Node.GetBestBlock()
_, currentHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -719,7 +719,7 @@ func testLazyNtfnConsumer(miner *rpctest.Harness,
// Add a block right before registering, this makes race conditions
// between the historical dispatcher and the normal dispatcher more obvious
if _, err := miner.Node.Generate(1); err != nil {
if _, err := miner.Client.Generate(1); err != nil {
t.Fatalf("unable to generate blocks: %v", err)
}
@@ -738,7 +738,7 @@ func testLazyNtfnConsumer(miner *rpctest.Harness,
}
// Generate another 2 blocks, this should dispatch the confirm notification
if _, err := miner.Node.Generate(2); err != nil {
if _, err := miner.Client.Generate(2); err != nil {
t.Fatalf("unable to generate blocks: %v", err)
}
@@ -753,7 +753,7 @@ func testLazyNtfnConsumer(miner *rpctest.Harness,
t.Fatalf("tx not relayed to miner: %v", err)
}
_, currentHeight, err = miner.Node.GetBestBlock()
_, currentHeight, err = miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -773,7 +773,7 @@ func testLazyNtfnConsumer(miner *rpctest.Harness,
t.Fatalf("unable to register ntfn: %v", err)
}
if _, err := miner.Node.Generate(1); err != nil {
if _, err := miner.Client.Generate(1); err != nil {
t.Fatalf("unable to generate blocks: %v", err)
}
@@ -806,14 +806,14 @@ func testSpendBeforeNtfnRegistration(miner *rpctest.Harness,
// To do so, we first create a new output to our test target address.
outpoint, output, privKey := chainntnfs.CreateSpendableOutput(t, miner)
_, heightHint, err := miner.Node.GetBestBlock()
_, heightHint, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
// We'll then spend this output and broadcast the spend transaction.
spendingTx := chainntnfs.CreateSpendTx(t, outpoint, output, privKey)
spenderSha, err := miner.Node.SendRawTransaction(spendingTx, true)
spenderSha, err := miner.Client.SendRawTransaction(spendingTx, true)
if err != nil {
t.Fatalf("unable to broadcast tx: %v", err)
}
@@ -829,10 +829,10 @@ func testSpendBeforeNtfnRegistration(miner *rpctest.Harness,
}
// Now we mine an additional block, which should include our spend.
if _, err := miner.Node.Generate(1); err != nil {
if _, err := miner.Client.Generate(1); err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
_, spendHeight, err := miner.Node.GetBestBlock()
_, spendHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -895,7 +895,7 @@ func testSpendBeforeNtfnRegistration(miner *rpctest.Harness,
// Bury the spend even deeper, and do the same check.
const numBlocks = 10
if _, err := miner.Node.Generate(numBlocks); err != nil {
if _, err := miner.Client.Generate(numBlocks); err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
@@ -925,7 +925,7 @@ func testCancelSpendNtfn(node *rpctest.Harness,
// ourselves.
outpoint, output, privKey := chainntnfs.CreateSpendableOutput(t, node)
_, currentHeight, err := node.Node.GetBestBlock()
_, currentHeight, err := node.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -961,7 +961,7 @@ func testCancelSpendNtfn(node *rpctest.Harness,
spendClients[1].Cancel()
// Broadcast our spending transaction.
spenderSha, err := node.Node.SendRawTransaction(spendingTx, true)
spenderSha, err := node.Client.SendRawTransaction(spendingTx, true)
if err != nil {
t.Fatalf("unable to broadcast tx: %v", err)
}
@@ -972,7 +972,7 @@ func testCancelSpendNtfn(node *rpctest.Harness,
// Now we mine a single block, which should include our spend. The
// notification should also be sent off.
if _, err := node.Node.Generate(1); err != nil {
if _, err := node.Client.Generate(1); err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
@@ -1036,7 +1036,7 @@ func testCancelEpochNtfn(node *rpctest.Harness,
// Now mine a single block, this should trigger the logic to dispatch
// epoch notifications.
if _, err := node.Node.Generate(1); err != nil {
if _, err := node.Client.Generate(1); err != nil {
t.Fatalf("unable to generate blocks: %v", err)
}
@@ -1089,12 +1089,12 @@ func testReorgConf(miner *rpctest.Harness,
}
// The two should be on the same blockheight.
_, nodeHeight1, err := miner.Node.GetBestBlock()
_, nodeHeight1, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current blockheight %v", err)
}
_, nodeHeight2, err := miner2.Node.GetBestBlock()
_, nodeHeight2, err := miner2.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current blockheight %v", err)
}
@@ -1106,7 +1106,7 @@ func testReorgConf(miner *rpctest.Harness,
// We disconnect the two nodes, such that we can start mining on them
// individually without the other one learning about the new blocks.
err = miner.Node.AddNode(miner2.P2PAddress(), rpcclient.ANRemove)
err = miner.Client.AddNode(miner2.P2PAddress(), rpcclient.ANRemove)
if err != nil {
t.Fatalf("unable to remove node: %v", err)
}
@@ -1119,7 +1119,7 @@ func testReorgConf(miner *rpctest.Harness,
t.Fatalf("tx not relayed to miner: %v", err)
}
_, currentHeight, err := miner.Node.GetBestBlock()
_, currentHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current height: %v", err)
}
@@ -1142,7 +1142,7 @@ func testReorgConf(miner *rpctest.Harness,
}
// Now generate a single block, the transaction should be included.
_, err = miner.Node.Generate(1)
_, err = miner.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
@@ -1157,7 +1157,7 @@ func testReorgConf(miner *rpctest.Harness,
// Reorganize transaction out of the chain by generating a longer fork
// from the other miner. The transaction is not included in this fork.
miner2.Node.Generate(2)
miner2.Client.Generate(2)
// Reconnect nodes to reach consensus on the longest chain. miner2's chain
// should win and become active on miner1.
@@ -1169,12 +1169,12 @@ func testReorgConf(miner *rpctest.Harness,
t.Fatalf("unable to join node on blocks: %v", err)
}
_, nodeHeight1, err = miner.Node.GetBestBlock()
_, nodeHeight1, err = miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current blockheight %v", err)
}
_, nodeHeight2, err = miner2.Node.GetBestBlock()
_, nodeHeight2, err = miner2.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current blockheight %v", err)
}
@@ -1195,12 +1195,12 @@ func testReorgConf(miner *rpctest.Harness,
// Now confirm the transaction on the longest chain and verify that we
// receive the notification.
tx, err := miner.Node.GetRawTransaction(txid)
tx, err := miner.Client.GetRawTransaction(txid)
if err != nil {
t.Fatalf("unable to get raw tx: %v", err)
}
txid, err = miner2.Node.SendRawTransaction(tx.MsgTx(), false)
txid, err = miner2.Client.SendRawTransaction(tx.MsgTx(), false)
if err != nil {
t.Fatalf("unable to get send tx: %v", err)
}
@@ -1208,7 +1208,7 @@ func testReorgConf(miner *rpctest.Harness,
t.Fatalf("tx not relayed to miner: %v", err)
}
_, err = miner.Node.Generate(3)
_, err = miner.Client.Generate(3)
if err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
@@ -1229,7 +1229,7 @@ func testReorgSpend(miner *rpctest.Harness,
// We'll start by creating an output and registering a spend
// notification for it.
outpoint, output, privKey := chainntnfs.CreateSpendableOutput(t, miner)
_, heightHint, err := miner.Node.GetBestBlock()
_, heightHint, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to retrieve current height: %v", err)
}
@@ -1270,11 +1270,11 @@ func testReorgSpend(miner *rpctest.Harness,
if err := rpctest.JoinNodes(nodeSlice, rpctest.Blocks); err != nil {
t.Fatalf("unable to sync miners: %v", err)
}
_, minerHeight1, err := miner.Node.GetBestBlock()
_, minerHeight1, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get miner1's current height: %v", err)
}
_, minerHeight2, err := miner2.Node.GetBestBlock()
_, minerHeight2, err := miner2.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get miner2's current height: %v", err)
}
@@ -1285,7 +1285,7 @@ func testReorgSpend(miner *rpctest.Harness,
// We disconnect the two nodes, such that we can start mining on them
// individually without the other one learning about the new blocks.
err = miner.Node.AddNode(miner2.P2PAddress(), rpcclient.ANRemove)
err = miner.Client.AddNode(miner2.P2PAddress(), rpcclient.ANRemove)
if err != nil {
t.Fatalf("unable to disconnect miners: %v", err)
}
@@ -1293,7 +1293,7 @@ func testReorgSpend(miner *rpctest.Harness,
// Craft the spending transaction for the outpoint created above and
// confirm it under the chain of the original miner.
spendTx := chainntnfs.CreateSpendTx(t, outpoint, output, privKey)
spendTxHash, err := miner.Node.SendRawTransaction(spendTx, true)
spendTxHash, err := miner.Client.SendRawTransaction(spendTx, true)
if err != nil {
t.Fatalf("unable to broadcast spend tx: %v", err)
}
@@ -1301,10 +1301,10 @@ func testReorgSpend(miner *rpctest.Harness,
t.Fatalf("spend tx not relayed to miner: %v", err)
}
const numBlocks = 1
if _, err := miner.Node.Generate(numBlocks); err != nil {
if _, err := miner.Client.Generate(numBlocks); err != nil {
t.Fatalf("unable to generate blocks: %v", err)
}
_, spendHeight, err := miner.Node.GetBestBlock()
_, spendHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get spend height: %v", err)
}
@@ -1322,7 +1322,7 @@ func testReorgSpend(miner *rpctest.Harness,
// Now, with the other miner, we'll generate one more block than the
// other miner and connect them to cause a reorg.
if _, err := miner2.Node.Generate(numBlocks + 1); err != nil {
if _, err := miner2.Client.Generate(numBlocks + 1); err != nil {
t.Fatalf("unable to generate blocks: %v", err)
}
if err := rpctest.ConnectNode(miner, miner2); err != nil {
@@ -1332,11 +1332,11 @@ func testReorgSpend(miner *rpctest.Harness,
if err := rpctest.JoinNodes(nodeSlice, rpctest.Blocks); err != nil {
t.Fatalf("unable to sync miners: %v", err)
}
_, minerHeight1, err = miner.Node.GetBestBlock()
_, minerHeight1, err = miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get miner1's current height: %v", err)
}
_, minerHeight2, err = miner2.Node.GetBestBlock()
_, minerHeight2, err = miner2.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get miner2's current height: %v", err)
}
@@ -1358,16 +1358,16 @@ func testReorgSpend(miner *rpctest.Harness,
// Now that both miners are on the same chain, we'll confirm the
// spending transaction of the outpoint and receive a notification for
// it.
if _, err = miner2.Node.SendRawTransaction(spendTx, true); err != nil {
if _, err = miner2.Client.SendRawTransaction(spendTx, true); err != nil {
t.Fatalf("unable to broadcast spend tx: %v", err)
}
if err := chainntnfs.WaitForMempoolTx(miner, spendTxHash); err != nil {
t.Fatalf("tx not relayed to miner: %v", err)
}
if _, err := miner.Node.Generate(numBlocks); err != nil {
if _, err := miner.Client.Generate(numBlocks); err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
_, spendHeight, err = miner.Node.GetBestBlock()
_, spendHeight, err = miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to retrieve current height: %v", err)
}
@@ -1392,7 +1392,7 @@ func testCatchUpClientOnMissedBlocks(miner *rpctest.Harness,
const numClients = 5
var wg sync.WaitGroup
outdatedHash, outdatedHeight, err := miner.Node.GetBestBlock()
outdatedHash, outdatedHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to retrieve current height: %v", err)
}
@@ -1400,7 +1400,7 @@ func testCatchUpClientOnMissedBlocks(miner *rpctest.Harness,
// This function is used by UnsafeStart to ensure all notifications
// are fully drained before clients register for notifications.
generateBlocks := func() error {
_, err = miner.Node.Generate(numBlocks)
_, err = miner.Client.Generate(numBlocks)
return err
}
@@ -1484,7 +1484,7 @@ func testCatchUpOnMissedBlocks(miner *rpctest.Harness,
const numClients = 5
var wg sync.WaitGroup
_, bestHeight, err := miner.Node.GetBestBlock()
_, bestHeight, err := miner.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current blockheight %v", err)
}
@@ -1492,7 +1492,7 @@ func testCatchUpOnMissedBlocks(miner *rpctest.Harness,
// This function is used by UnsafeStart to ensure all notifications
// are fully drained before clients register for notifications.
generateBlocks := func() error {
_, err = miner.Node.Generate(numBlocks)
_, err = miner.Client.Generate(numBlocks)
return err
}
@@ -1527,7 +1527,7 @@ func testCatchUpOnMissedBlocks(miner *rpctest.Harness,
// Generate a single block to trigger the backlog of historical
// notifications for the previously mined blocks.
if _, err := miner.Node.Generate(1); err != nil {
if _, err := miner.Client.Generate(1); err != nil {
t.Fatalf("unable to generate blocks: %v", err)
}
@@ -1618,12 +1618,12 @@ func testCatchUpOnMissedBlocksWithReorg(miner1 *rpctest.Harness,
}
// The two should be on the same blockheight.
_, nodeHeight1, err := miner1.Node.GetBestBlock()
_, nodeHeight1, err := miner1.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current blockheight %v", err)
}
_, nodeHeight2, err := miner2.Node.GetBestBlock()
_, nodeHeight2, err := miner2.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current blockheight %v", err)
}
@@ -1635,20 +1635,20 @@ func testCatchUpOnMissedBlocksWithReorg(miner1 *rpctest.Harness,
// We disconnect the two nodes, such that we can start mining on them
// individually without the other one learning about the new blocks.
err = miner1.Node.AddNode(miner2.P2PAddress(), rpcclient.ANRemove)
err = miner1.Client.AddNode(miner2.P2PAddress(), rpcclient.ANRemove)
if err != nil {
t.Fatalf("unable to remove node: %v", err)
}
// Now mine on each chain separately
blocks, err := miner1.Node.Generate(numBlocks)
blocks, err := miner1.Client.Generate(numBlocks)
if err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
// We generate an extra block on miner 2's chain to ensure it is the
// longer chain.
_, err = miner2.Node.Generate(numBlocks + 1)
_, err = miner2.Client.Generate(numBlocks + 1)
if err != nil {
t.Fatalf("unable to generate single block: %v", err)
}
@@ -1665,12 +1665,12 @@ func testCatchUpOnMissedBlocksWithReorg(miner1 *rpctest.Harness,
// The two should be on the same block hash.
timeout := time.After(10 * time.Second)
for {
nodeHash1, _, err := miner1.Node.GetBestBlock()
nodeHash1, _, err := miner1.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current block hash: %v", err)
}
nodeHash2, _, err := miner2.Node.GetBestBlock()
nodeHash2, _, err := miner2.Client.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current block hash: %v", err)
}
@@ -1721,7 +1721,7 @@ func testCatchUpOnMissedBlocksWithReorg(miner1 *rpctest.Harness,
// Generate a single block, which should trigger the notifier to rewind
// to the common ancestor and dispatch notifications from there.
_, err = miner2.Node.Generate(1)
_, err = miner2.Client.Generate(1)
if err != nil {
t.Fatalf("unable to generate single block: %v", err)
}