Skip to content

Commit

Permalink
chainntnfs: fix test testSingleConfirmationNotification
Browse files Browse the repository at this point in the history
  • Loading branch information
yyforyongyu committed Dec 19, 2024
1 parent 2d62917 commit a55d75a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions chainntnfs/test/test_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ func testSingleConfirmationNotification(miner *rpctest.Harness,
// function.
txid, pkScript, err := chainntnfs.GetTestTxidAndScript(miner)
require.NoError(t, err, "unable to create test tx")
if err := chainntnfs.WaitForMempoolTx(miner, txid); err != nil {
t.Fatalf("tx not relayed to miner: %v", err)
}
err = chainntnfs.WaitForMempoolTx(miner, txid)
require.NoError(t, err, "tx not relayed to miner")

_, currentHeight, err := miner.Client.GetBestBlock()
require.NoError(t, err, "unable to get current height")
Expand All @@ -68,6 +67,10 @@ func testSingleConfirmationNotification(miner *rpctest.Harness,
blockHash, err := miner.Client.Generate(1)
require.NoError(t, err, "unable to generate single block")

// Assert the above tx is mined in the block.
block, err := miner.Client.GetBlock(blockHash[0])

Check failure on line 71 in chainntnfs/test/test_interface.go

View workflow job for this annotation

GitHub Actions / lint code

ineffectual assignment to err (ineffassign)
require.Len(t, block.Transactions, 2, "block does not contain tx")

select {
case confInfo := <-confIntent.Confirmed:
if !confInfo.BlockHash.IsEqual(blockHash[0]) {
Expand Down

0 comments on commit a55d75a

Please sign in to comment.