itest+lntest: stop using pointer to chainhash.Hash

This commit fixes the methods used in `lntest` so they stop using
pointers to chainhash.
This commit is contained in:
yyforyongyu
2024-10-17 07:14:51 +08:00
parent af6b88a9f6
commit ed3cb26188
16 changed files with 99 additions and 93 deletions

View File

@@ -214,7 +214,7 @@ func testSweepCPFPAnchorOutgoingTimeout(ht *lntest.HarnessTest) {
txns := ht.GetNumTxsFromMempool(2)
// Find the sweeping tx.
sweepTx := ht.FindSweepingTxns(txns, 1, *closeTxid)[0]
sweepTx := ht.FindSweepingTxns(txns, 1, closeTxid)[0]
// Get the weight for Bob's anchor sweeping tx.
txWeight := ht.CalculateTxWeight(sweepTx)
@@ -281,7 +281,7 @@ func testSweepCPFPAnchorOutgoingTimeout(ht *lntest.HarnessTest) {
txns = ht.GetNumTxsFromMempool(2)
// Find the sweeping tx.
sweepTx = ht.FindSweepingTxns(txns, 1, *closeTxid)[0]
sweepTx = ht.FindSweepingTxns(txns, 1, closeTxid)[0]
// Calculate the fee rate of Bob's new sweeping tx.
feeRate = uint64(ht.CalculateTxFeeRate(sweepTx))
@@ -320,7 +320,7 @@ func testSweepCPFPAnchorOutgoingTimeout(ht *lntest.HarnessTest) {
txns = ht.GetNumTxsFromMempool(2)
// Find the sweeping tx.
sweepTx = ht.FindSweepingTxns(txns, 1, *closeTxid)[0]
sweepTx = ht.FindSweepingTxns(txns, 1, closeTxid)[0]
// Calculate the fee of Bob's new sweeping tx.
fee = uint64(ht.CalculateTxFee(sweepTx))
@@ -341,7 +341,7 @@ func testSweepCPFPAnchorOutgoingTimeout(ht *lntest.HarnessTest) {
txns = ht.GetNumTxsFromMempool(2)
// Find the sweeping tx.
currentSweepTx := ht.FindSweepingTxns(txns, 1, *closeTxid)[0]
currentSweepTx := ht.FindSweepingTxns(txns, 1, closeTxid)[0]
// Assert the anchor sweep tx stays unchanged.
require.Equal(ht, sweepTx.TxHash(), currentSweepTx.TxHash())
@@ -553,7 +553,7 @@ func testSweepCPFPAnchorIncomingTimeout(ht *lntest.HarnessTest) {
txns := ht.GetNumTxsFromMempool(2)
// Find the sweeping tx.
sweepTx := ht.FindSweepingTxns(txns, 1, *closeTxid)[0]
sweepTx := ht.FindSweepingTxns(txns, 1, closeTxid)[0]
// Get the weight for Bob's anchor sweeping tx.
txWeight := ht.CalculateTxWeight(sweepTx)
@@ -620,7 +620,7 @@ func testSweepCPFPAnchorIncomingTimeout(ht *lntest.HarnessTest) {
txns = ht.GetNumTxsFromMempool(2)
// Find the sweeping tx.
sweepTx = ht.FindSweepingTxns(txns, 1, *closeTxid)[0]
sweepTx = ht.FindSweepingTxns(txns, 1, closeTxid)[0]
// Calculate the fee rate of Bob's new sweeping tx.
feeRate = uint64(ht.CalculateTxFeeRate(sweepTx))
@@ -659,7 +659,7 @@ func testSweepCPFPAnchorIncomingTimeout(ht *lntest.HarnessTest) {
txns = ht.GetNumTxsFromMempool(2)
// Find the sweeping tx.
sweepTx = ht.FindSweepingTxns(txns, 1, *closeTxid)[0]
sweepTx = ht.FindSweepingTxns(txns, 1, closeTxid)[0]
// Calculate the fee of Bob's new sweeping tx.
fee = uint64(ht.CalculateTxFee(sweepTx))
@@ -680,7 +680,7 @@ func testSweepCPFPAnchorIncomingTimeout(ht *lntest.HarnessTest) {
txns = ht.GetNumTxsFromMempool(2)
// Find the sweeping tx.
currentSweepTx := ht.FindSweepingTxns(txns, 1, *closeTxid)[0]
currentSweepTx := ht.FindSweepingTxns(txns, 1, closeTxid)[0]
// Assert the anchor sweep tx stays unchanged.
require.Equal(ht, sweepTx.TxHash(), currentSweepTx.TxHash())
@@ -2274,7 +2274,7 @@ func testBumpForceCloseFee(ht *lntest.HarnessTest) {
// this anchor sweep transaction (because of the small fee delta).
ht.MineEmptyBlocks(1)
cpfpHash1 := cpfpSweep1.TxHash()
ht.AssertTxInMempool(&cpfpHash1)
ht.AssertTxInMempool(cpfpHash1)
// Now Bump the fee rate again with a bigger starting fee rate of the
// fee function.