Merge #20876: test: Replace getmempoolentry with testmempoolaccept in MiniWallet

faabc26a61873b2cd0390a21df571fe53c893c11 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 faabc26a61873b2cd0390a21df571fe53c893c11

Tree-SHA512: 4260a59e65fed1c807530dad23f1996ba6e881bcce91995f5b498a0be6001f67b3e0251507c8801750fe105410147c68bb2f393ebe678c6a3a4d045e5d72fc19
This commit is contained in:
MarcoFalke 2021-01-11 08:57:23 +01:00 committed by pasta
parent 471c2cb211
commit 52ff3ec054
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -58,9 +58,13 @@ class MiniWallet:
tx.vin[0].scriptSig = CScript([CScript([OP_TRUE])])
tx_hex = tx.serialize().hex()
txid = from_node.sendrawtransaction(tx_hex)
self._utxos.append({'txid': txid, 'vout': 0, 'value': send_value})
tx_info = from_node.getmempoolentry(txid)
assert_equal(tx_info['vsize'], vsize)
assert_equal(tx_info['fee'], fee)
return {'txid': txid, 'hex': tx_hex}
tx_info = from_node.testmempoolaccept([tx_hex])[0]
self._utxos.append({'txid': tx_info['txid'], 'vout': 0, 'value': send_value})
from_node.sendrawtransaction(tx_hex)
assert_equal(len(tx_hex) // 2, vsize)
# Dash doesn't have `fees` in this RPC result
# TODO drop this variable after 19940
b19940_done = False
if b19940_done:
assert_equal(tx_info['fees']['base'], fee)
return {'txid': tx_info['txid'], 'hex': tx_hex}