Skip to content

Commit 91b0597

Browse files
committed
Improve mempool_accept_wtxid.py
Improve mempool_accept_wtxid.py Improve mempool_accept_wtxid.py Improve mempool_accept_wtxid.py Improve mempool_accept_wtxid.py
1 parent 1488f55 commit 91b0597

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/functional/mempool_accept_wtxid.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""
66
Test mempool acceptance in case of an already known transaction
7-
with identical non-witness data different witness.
7+
with identical non-witness data but different witness.
88
"""
99

10+
from copy import deepcopy
1011
from test_framework.messages import (
1112
COIN,
1213
COutPoint,
@@ -79,10 +80,7 @@ def run_test(self):
7980
child_one_txid = child_one.rehash()
8081

8182
# Create another identical transaction with witness solving second branch
82-
child_two = CTransaction()
83-
child_two.vin.append(CTxIn(COutPoint(int(parent_txid, 16), 0), b""))
84-
child_two.vout.append(CTxOut(int(9.99996 * COIN), child_script_pubkey))
85-
child_two.wit.vtxinwit.append(CTxInWitness())
83+
child_two = deepcopy(child_one)
8684
child_two.wit.vtxinwit[0].scriptWitness.stack = [b'', witness_script]
8785
child_two_wtxid = child_two.getwtxid()
8886
child_two_txid = child_two.rehash()
@@ -104,8 +102,7 @@ def run_test(self):
104102
"allowed": False,
105103
"reject-reason": "txn-already-in-mempool"
106104
}])
107-
testres_child_two = node.testmempoolaccept([child_two.serialize().hex()])[0]
108-
assert_equal(testres_child_two, {
105+
assert_equal(node.testmempoolaccept([child_two.serialize().hex()])[0], {
109106
"txid": child_two_txid,
110107
"wtxid": child_two_wtxid,
111108
"allowed": False,

0 commit comments

Comments
 (0)