mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-18 05:13:36 +01:00
Merge pull request #9378 from yyforyongyu/fix-unit-test
chainntnfs: fix test `testSingleConfirmationNotification`
This commit is contained in:
commit
1b0f41da48
@ -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")
|
||||
@ -68,6 +67,11 @@ 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])
|
||||
require.NoError(t, err)
|
||||
require.Len(t, block.Transactions, 2, "block does not contain tx")
|
||||
|
||||
select {
|
||||
case confInfo := <-confIntent.Confirmed:
|
||||
if !confInfo.BlockHash.IsEqual(blockHash[0]) {
|
||||
|
Loading…
Reference in New Issue
Block a user