Skip to content

Commit 9c0b76c

Browse files
author
MarcoFalke
committed
Merge #20876: test: Replace getmempoolentry with testmempoolaccept in MiniWallet
faabc26 test: Replace getmempoolentry with testmempoolaccept in MiniWallet (MarcoFalke) Pull request description: This is a refactor to not use the return value of `sendrawtransaction` and `getmempoolentry` with the goal that submitting the tx to the mempool will become optional. ACKs for top commit: mjdietzx: ACK faabc26 Tree-SHA512: 4260a59e65fed1c807530dad23f1996ba6e881bcce91995f5b498a0be6001f67b3e0251507c8801750fe105410147c68bb2f393ebe678c6a3a4d045e5d72fc19
2 parents bd6af53 + faabc26 commit 9c0b76c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/functional/test_framework/wallet.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ def send_self_transfer(self, *, fee_rate=Decimal("0.003"), from_node, utxo_to_sp
7171
tx.wit.vtxinwit[0].scriptWitness.stack = [CScript([OP_TRUE])]
7272
tx_hex = tx.serialize().hex()
7373

74-
txid = from_node.sendrawtransaction(tx_hex)
75-
self._utxos.append({'txid': txid, 'vout': 0, 'value': send_value})
76-
tx_info = from_node.getmempoolentry(txid)
74+
tx_info = from_node.testmempoolaccept([tx_hex])[0]
75+
self._utxos.append({'txid': tx_info['txid'], 'vout': 0, 'value': send_value})
76+
from_node.sendrawtransaction(tx_hex)
7777
assert_equal(tx_info['vsize'], vsize)
78-
assert_equal(tx_info['fee'], fee)
79-
return {'txid': txid, 'wtxid': tx_info['wtxid'], 'hex': tx_hex}
78+
assert_equal(tx_info['fees']['base'], fee)
79+
return {'txid': tx_info['txid'], 'wtxid': from_node.decoderawtransaction(tx_hex)['hash'], 'hex': tx_hex}

0 commit comments

Comments
 (0)