4
4
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
"""
6
6
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.
8
8
"""
9
9
10
+ from copy import deepcopy
10
11
from test_framework .messages import (
11
12
COIN ,
12
13
COutPoint ,
@@ -79,10 +80,7 @@ def run_test(self):
79
80
child_one_txid = child_one .rehash ()
80
81
81
82
# 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 )
86
84
child_two .wit .vtxinwit [0 ].scriptWitness .stack = [b'' , witness_script ]
87
85
child_two_wtxid = child_two .getwtxid ()
88
86
child_two_txid = child_two .rehash ()
@@ -104,8 +102,7 @@ def run_test(self):
104
102
"allowed" : False ,
105
103
"reject-reason" : "txn-already-in-mempool"
106
104
}])
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 ], {
109
106
"txid" : child_two_txid ,
110
107
"wtxid" : child_two_wtxid ,
111
108
"allowed" : False ,
0 commit comments