Skip to content

Commit bafe5d0

Browse files
committed
chainntnfs: fix test testSingleConfirmationNotification
1 parent a388c1f commit bafe5d0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

chainntnfs/test/test_interface.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ func testSingleConfirmationNotification(miner *rpctest.Harness,
4141
// function.
4242
txid, pkScript, err := chainntnfs.GetTestTxidAndScript(miner)
4343
require.NoError(t, err, "unable to create test tx")
44-
if err := chainntnfs.WaitForMempoolTx(miner, txid); err != nil {
45-
t.Fatalf("tx not relayed to miner: %v", err)
46-
}
44+
err = chainntnfs.WaitForMempoolTx(miner, txid)
45+
require.NoError(t, err, "tx not relayed to miner")
4746

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

70+
// Assert the above tx is mined in the block.
71+
block, err := miner.Client.GetBlock(blockHash[0])
72+
require.NoError(t, err)
73+
require.Len(t, block.Transactions, 2, "block does not contain tx")
74+
7175
select {
7276
case confInfo := <-confIntent.Confirmed:
7377
if !confInfo.BlockHash.IsEqual(blockHash[0]) {

0 commit comments

Comments
 (0)