Remove manual byte editing in wallet_tx_clone func test #15397
pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:wallet_clone_magic changing 1 files +7 −10-
instagibbs commented at 2:52 pm on February 13, 2019: memberAdapted from @stevenroose
-
Remove manual byte editing in wallet_tx_clone func test 6aaa0abc12
-
stevenroose commented at 3:12 pm on February 13, 2019: contributor
-
MarcoFalke added this to the milestone 0.19.0 on Feb 13, 2019
-
in test/functional/wallet_txn_clone.py:84 in 6aaa0abc12
89+ (clone_tx.vout[0], clone_tx.vout[1]) = (clone_tx.vout[1], clone_tx.vout[0]) 90 91 # Use a different signature hash type to sign. This creates an equivalent but malleated clone. 92 # Don't send the clone anywhere yet 93- tx1_clone = self.nodes[0].signrawtransactionwithwallet(clone_raw, None, "ALL|ANYONECANPAY") 94+ tx1_clone = self.nodes[0].signrawtransactionwithwallet(clone_tx.serialize().hex(), None, "ALL|ANYONECANPAY")
MarcoFalke commented at 3:51 pm on February 13, 2019:Assigned 0.19.0, because this is python3.5 only
instagibbs commented at 3:59 pm on February 13, 2019:SGTM, I like the syntax way more. So should I ping once 0.18 is branched?
MarcoFalke commented at 4:09 pm on February 13, 2019:Remind me #14954
MarcoFalke commented at 2:20 pm on February 18, 2019:Already broken in
master
, so just going to merge this as well :woman_shrugging:0$ git grep -l '\.hex()' test/ 1test/functional/mining_basic.py 2test/functional/test_framework/wallet_util.py 3test/functional/wallet_txn_clone.py
instagibbs commented at 2:23 pm on February 18, 2019:Yeah at least partially my bad :1st_place_medal:in test/functional/wallet_txn_clone.py:80 in 6aaa0abc12
84- output1 = clone_raw[pos0 + output_len:pos0 + 2 * output_len] 85- clone_raw = clone_raw[:pos0] + output1 + output0 + clone_raw[pos0 + 2 * output_len:] 86+ clone_tx = CTransaction() 87+ clone_tx.deserialize(io.BytesIO(bytes.fromhex(clone_raw))) 88+ if (rawtx1["vout"][0]["value"] == 40 and clone_tx.vout[0].nValue != 40*COIN or rawtx1["vout"][0]["value"] != 40 and clone_tx.vout[0].nValue == 40*COIN): 89+ (clone_tx.vout[0], clone_tx.vout[1]) = (clone_tx.vout[1], clone_tx.vout[0])
MarcoFalke commented at 3:52 pm on February 13, 2019:nice swap
practicalswift commented at 5:49 pm on February 13, 2019:Nit: Parantheses redundant :-)MarcoFalke approvedMarcoFalke added the label Tests on Feb 13, 2019in test/functional/wallet_txn_clone.py:79 in 6aaa0abc12
83- output0 = clone_raw[pos0:pos0 + output_len] 84- output1 = clone_raw[pos0 + output_len:pos0 + 2 * output_len] 85- clone_raw = clone_raw[:pos0] + output1 + output0 + clone_raw[pos0 + 2 * output_len:] 86+ clone_tx = CTransaction() 87+ clone_tx.deserialize(io.BytesIO(bytes.fromhex(clone_raw))) 88+ if (rawtx1["vout"][0]["value"] == 40 and clone_tx.vout[0].nValue != 40*COIN or rawtx1["vout"][0]["value"] != 40 and clone_tx.vout[0].nValue == 40*COIN):
practicalswift commented at 5:49 pm on February 13, 2019:Nit: Parantheses redundant :-)jonasschnelli commented at 1:55 am on February 14, 2019: contributorOh yes. Thanks for doing this. utACK 6aaa0abc1241ad26f5895760701e77c9c8e93924 once 0.18 is branched off.MarcoFalke merged this on Feb 18, 2019MarcoFalke closed this on Feb 18, 2019
MarcoFalke referenced this in commit 6ba3f1fdfd on Feb 18, 2019MarcoFalke referenced this in commit f9775a8655 on Feb 20, 2019jasonbcox referenced this in commit 48be096909 on Nov 11, 2020vijaydasmp referenced this in commit e4cc574adb on Sep 5, 2021Munkybooty referenced this in commit bab6f73d41 on Sep 5, 2021vijaydasmp referenced this in commit 11dd890928 on Sep 6, 2021Munkybooty referenced this in commit 4e0492847d on Sep 7, 2021Munkybooty referenced this in commit ed5543e6bf on Sep 7, 2021Munkybooty referenced this in commit bc7ca5d837 on Sep 7, 2021Munkybooty referenced this in commit b654e48dbc on Sep 7, 2021DrahtBot locked this on Sep 6, 2022
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-18 03:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me