closes #23641
tests: Add data-driven testcases to rpc_decodescript.py #23672
pull Kvaciral wants to merge 1 commits into bitcoin:master from Kvaciral:functest_rpcdecodescript changing 2 files +133 −0-
Kvaciral commented at 3:37 PM on December 4, 2021: contributor
- laanwj added the label Tests on Dec 4, 2021
-
jamesob commented at 4:13 PM on December 4, 2021: member
Nice, concept ACK
-
brunoerg commented at 7:44 PM on December 4, 2021: member
Concept ACK
- brunoerg approved
-
brunoerg commented at 8:00 PM on December 4, 2021: member
tACK f7ddfef9371f476533ddbbc1cf0c8520c01f8e42
- alirezaayande approved
-
in test/functional/rpc_decodescript.py:262 in f7ddfef937 outdated
254 | @@ -252,13 +255,23 @@ def decoderawtransaction_asm_sighashtype(self): 255 | rpc_result = self.nodes[0].decoderawtransaction(txSave.serialize().hex()) 256 | assert_equal('OP_RETURN 3011020701010101010101020601010101010101', rpc_result['vin'][0]['scriptSig']['asm']) 257 | 258 | + def decodescript_datadriven_tests(self): 259 | + with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data/rpc_decodescript.json'), encoding='utf-8') as f: 260 | + dd_tests = json.load(f) 261 | + 262 | + for dd_test in dd_tests:
MarcoFalke commented at 8:42 AM on December 5, 2021:nit: If you make
dd_testsa dictionary of the form{ 'input1': { ... rpc result ... }, 'input2': {...}, ...}, you can avoid the array indices.for script, result in dd_tests:
laanwj commented at 3:50 PM on December 5, 2021:I think that should work if you don't change the data type?
,would unpack the arrays. When converting to a dictionary you'd need to iterate overdd_tests.items().MarcoFalke approvedMarcoFalke commented at 8:43 AM on December 5, 2021: memberThanks, ACK
tests: Add data-driven testcases to rpc_decodescript.py b35942e500MarcoFalke merged this on Dec 6, 2021MarcoFalke closed this on Dec 6, 2021sidhujag referenced this in commit 20b6b60d94 on Dec 6, 2021RandyMcMillan referenced this in commit 4b6a6838b3 on Dec 23, 2021DrahtBot locked this on Dec 6, 2022Labels
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: 2026-04-28 06:14 UTC
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: 2026-04-28 06:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me