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 committed 2024-10-17 07:14:51 +08:00
1 parent af6b88a9f6
commit ed3cb26188
16 files changed
+99 -93

No files matched your search

+6 -6
View File
@@ -113,7 +113,7 @@ func (h *HarnessTest) MineBlocksAndAssertNumTxes(num uint32,
// Make sure the mempool has been updated.
for _, txid := range txids {
h.miner.AssertTxNotInMempool(*txid)
h.miner.AssertTxNotInMempool(txid)
}
// Finally, make sure all the active nodes are synced.
@@ -202,7 +202,7 @@ func (h *HarnessTest) mineTillForceCloseResolved(hn *node.HarnessNode) {
}
// AssertTxInMempool asserts a given transaction can be found in the mempool.
func (h *HarnessTest) AssertTxInMempool(txid *chainhash.Hash) *wire.MsgTx {
func (h *HarnessTest) AssertTxInMempool(txid chainhash.Hash) *wire.MsgTx {
return h.miner.AssertTxInMempool(txid)
}
@@ -219,7 +219,7 @@ func (h *HarnessTest) AssertTxNotInMempool(txid chainhash.Hash) *wire.MsgTx {
// AssertNumTxsInMempool polls until finding the desired number of transactions
// in the provided miner's mempool. It will assert if this number is not met
// after the given timeout.
func (h *HarnessTest) AssertNumTxsInMempool(n int) []*chainhash.Hash {
func (h *HarnessTest) AssertNumTxsInMempool(n int) []chainhash.Hash {
return h.miner.AssertNumTxsInMempool(n)
}
@@ -230,7 +230,7 @@ func (h *HarnessTest) AssertOutpointInMempool(op wire.OutPoint) *wire.MsgTx {
// AssertTxInBlock asserts that a given txid can be found in the passed block.
func (h *HarnessTest) AssertTxInBlock(block *wire.MsgBlock,
txid *chainhash.Hash) {
txid chainhash.Hash) {
h.miner.AssertTxInBlock(block, txid)
}
@@ -263,13 +263,13 @@ func (h *HarnessTest) DisconnectFromMiner(tempMiner *miner.HarnessMiner) {
// GetRawMempool makes a RPC call to the miner's GetRawMempool and
// asserts.
func (h *HarnessTest) GetRawMempool() []*chainhash.Hash {
func (h *HarnessTest) GetRawMempool() []chainhash.Hash {
return h.miner.GetRawMempool()
}
// GetRawTransaction makes a RPC call to the miner's GetRawTransaction and
// asserts.
func (h *HarnessTest) GetRawTransaction(txid *chainhash.Hash) *btcutil.Tx {
func (h *HarnessTest) GetRawTransaction(txid chainhash.Hash) *btcutil.Tx {
return h.miner.GetRawTransaction(txid)
}