mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 18:51:15 +02:00
rpc: Return wtxid from testmempoolaccept
This commit is contained in:
@ -686,13 +686,35 @@ class SegWitTest(BitcoinTestFramework):
|
||||
if not self.segwit_active:
|
||||
# Just check mempool acceptance, but don't add the transaction to the mempool, since witness is disallowed
|
||||
# in blocks and the tx is impossible to mine right now.
|
||||
assert_equal(self.nodes[0].testmempoolaccept([tx3.serialize_with_witness().hex()]), [{'txid': tx3.hash, 'allowed': True, 'vsize': tx3.get_vsize(), 'fees': { 'base': Decimal('0.00001000')}}])
|
||||
assert_equal(
|
||||
self.nodes[0].testmempoolaccept([tx3.serialize_with_witness().hex()]),
|
||||
[{
|
||||
'txid': tx3.hash,
|
||||
'wtxid': tx3.getwtxid(),
|
||||
'allowed': True,
|
||||
'vsize': tx3.get_vsize(),
|
||||
'fees': {
|
||||
'base': Decimal('0.00001000'),
|
||||
},
|
||||
}],
|
||||
)
|
||||
# Create the same output as tx3, but by replacing tx
|
||||
tx3_out = tx3.vout[0]
|
||||
tx3 = tx
|
||||
tx3.vout = [tx3_out]
|
||||
tx3.rehash()
|
||||
assert_equal(self.nodes[0].testmempoolaccept([tx3.serialize_with_witness().hex()]), [{'txid': tx3.hash, 'allowed': True, 'vsize': tx3.get_vsize(), 'fees': { 'base': Decimal('0.00011000')}}])
|
||||
assert_equal(
|
||||
self.nodes[0].testmempoolaccept([tx3.serialize_with_witness().hex()]),
|
||||
[{
|
||||
'txid': tx3.hash,
|
||||
'wtxid': tx3.getwtxid(),
|
||||
'allowed': True,
|
||||
'vsize': tx3.get_vsize(),
|
||||
'fees': {
|
||||
'base': Decimal('0.00011000'),
|
||||
},
|
||||
}],
|
||||
)
|
||||
test_transaction_acceptance(self.nodes[0], self.test_node, tx3, with_witness=True, accepted=True)
|
||||
|
||||
self.nodes[0].generate(1)
|
||||
|
Reference in New Issue
Block a user