test: Set maxfeerate=0 in MiniWallet sendrawtransaction()

pull/25262/head
MacroFake 2 years ago
parent 9cc010f5a9
commit fafaad98f7
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

@ -76,7 +76,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
tx.vout[0].nValue = int(0.3 * COIN) tx.vout[0].nValue = int(0.3 * COIN)
tx.vout[1].nValue = int(49 * COIN) tx.vout[1].nValue = int(49 * COIN)
raw_tx_in_block = tx.serialize().hex() raw_tx_in_block = tx.serialize().hex()
txid_in_block = self.wallet.sendrawtransaction(from_node=node, tx_hex=raw_tx_in_block, maxfeerate=0) txid_in_block = self.wallet.sendrawtransaction(from_node=node, tx_hex=raw_tx_in_block)
self.generate(node, 1) self.generate(node, 1)
self.mempool_size = 0 self.mempool_size = 0
self.check_mempool_result( self.check_mempool_result(
@ -166,7 +166,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
tx.vin[1].prevout = COutPoint(hash=int(txid_1, 16), n=0) tx.vin[1].prevout = COutPoint(hash=int(txid_1, 16), n=0)
tx.vout[0].nValue = int(0.1 * COIN) tx.vout[0].nValue = int(0.1 * COIN)
raw_tx_spend_both = tx.serialize().hex() raw_tx_spend_both = tx.serialize().hex()
txid_spend_both = self.wallet.sendrawtransaction(from_node=node, tx_hex=raw_tx_spend_both, maxfeerate=0) txid_spend_both = self.wallet.sendrawtransaction(from_node=node, tx_hex=raw_tx_spend_both)
self.generate(node, 1) self.generate(node, 1)
self.mempool_size = 0 self.mempool_size = 0
# Now see if we can add the coins back to the utxo set by sending the exact txs again # Now see if we can add the coins back to the utxo set by sending the exact txs again

@ -277,8 +277,8 @@ class MiniWallet:
return {'txid': tx.rehash(), 'wtxid': tx.getwtxid(), 'hex': tx_hex, 'tx': tx} return {'txid': tx.rehash(), 'wtxid': tx.getwtxid(), 'hex': tx_hex, 'tx': tx}
def sendrawtransaction(self, *, from_node, tx_hex, **kwargs): def sendrawtransaction(self, *, from_node, tx_hex, maxfeerate=0, **kwargs):
txid = from_node.sendrawtransaction(hexstring=tx_hex, **kwargs) txid = from_node.sendrawtransaction(hexstring=tx_hex, maxfeerate=maxfeerate, **kwargs)
self.scan_tx(from_node.decoderawtransaction(tx_hex)) self.scan_tx(from_node.decoderawtransaction(tx_hex))
return txid return txid

Loading…
Cancel
Save