lntest+itest: finalize moving miner methods

This commit is contained in:
yyforyongyu
2024-05-01 20:41:47 +08:00
committed by yyforyongyu
parent 6bd8baea38
commit be4dba5da6
18 changed files with 129 additions and 55 deletions

View File

@@ -950,7 +950,7 @@ func testZeroConfReorg(ht *lntest.HarnessTest) {
// exists in the graph.
//
// First, we'll setup a new miner that we can use to cause a reorg.
tempMiner := ht.Miner.SpawnTempMiner()
tempMiner := ht.SpawnTempMiner()
// We now cause a fork, by letting our original miner mine 1 block and
// our new miner will mine 2. We also expect the funding transition to
@@ -959,7 +959,7 @@ func testZeroConfReorg(ht *lntest.HarnessTest) {
tempMiner.MineEmptyBlocks(2)
// Ensure the temp miner is one block ahead.
ht.Miner.AssertMinerBlockHeightDelta(tempMiner, 1)
ht.AssertMinerBlockHeightDelta(tempMiner, 1)
// Wait for Carol to sync to the original miner's chain.
_, minerHeight := ht.GetBestBlock()
@@ -972,14 +972,14 @@ func testZeroConfReorg(ht *lntest.HarnessTest) {
// Connecting to the temporary miner should cause the original miner to
// reorg to the longer chain.
ht.Miner.ConnectMiner(tempMiner)
ht.ConnectToMiner(tempMiner)
// They should now be on the same chain.
ht.Miner.AssertMinerBlockHeightDelta(tempMiner, 0)
ht.AssertMinerBlockHeightDelta(tempMiner, 0)
// Now we disconnect the two miners and reconnect our original chain
// backend.
ht.Miner.DisconnectMiner(tempMiner)
ht.DisconnectFromMiner(tempMiner)
ht.ConnectMiner()