From 525cbd425e2f6a1dbd0febc53d7ada22cec4661f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 15 Oct 2020 20:57:58 -0700 Subject: Only relay Taproot spends if next block has it active --- test/functional/feature_taproot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/functional/feature_taproot.py b/test/functional/feature_taproot.py index 7b534c1c2f..1d2e346aa8 100755 --- a/test/functional/feature_taproot.py +++ b/test/functional/feature_taproot.py @@ -1129,13 +1129,13 @@ def spenders_taproot_inactive(): ] tap = taproot_construct(pub, scripts) - # Test that keypath spending is valid & standard if compliant, but valid and nonstandard otherwise. - add_spender(spenders, "inactive/keypath_valid", key=sec, tap=tap) + # Test that keypath spending is valid & non-standard, regardless of validity. + add_spender(spenders, "inactive/keypath_valid", key=sec, tap=tap, standard=False) add_spender(spenders, "inactive/keypath_invalidsig", key=sec, tap=tap, standard=False, sighash=bitflipper(default_sighash)) add_spender(spenders, "inactive/keypath_empty", key=sec, tap=tap, standard=False, witness=[]) - # Same for scriptpath spending (but using future features like annex, leaf versions, or OP_SUCCESS is nonstandard). - add_spender(spenders, "inactive/scriptpath_valid", key=sec, tap=tap, leaf="pk", inputs=[getter("sign")]) + # Same for scriptpath spending (and features like annex, leaf versions, or OP_SUCCESS don't change this) + add_spender(spenders, "inactive/scriptpath_valid", key=sec, tap=tap, leaf="pk", standard=False, inputs=[getter("sign")]) add_spender(spenders, "inactive/scriptpath_invalidsig", key=sec, tap=tap, leaf="pk", standard=False, inputs=[getter("sign")], sighash=bitflipper(default_sighash)) add_spender(spenders, "inactive/scriptpath_invalidcb", key=sec, tap=tap, leaf="pk", standard=False, inputs=[getter("sign")], controlblock=bitflipper(default_controlblock)) add_spender(spenders, "inactive/scriptpath_valid_unkleaf", key=sec, tap=tap, leaf="future_leaf", standard=False, inputs=[getter("sign")]) -- cgit v1.2.3 From 3d0556d41087f945ed0a47a5d770076ad42ce432 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 30 Oct 2020 15:51:51 -0700 Subject: Increase feature_taproot inactive test coverage --- test/functional/feature_taproot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/functional/feature_taproot.py b/test/functional/feature_taproot.py index 1d2e346aa8..3e47e24a3b 100755 --- a/test/functional/feature_taproot.py +++ b/test/functional/feature_taproot.py @@ -1451,7 +1451,11 @@ class TaprootTest(BitcoinTestFramework): # Pre-taproot activation tests. self.log.info("Pre-activation tests...") - self.test_spenders(self.nodes[0], spenders_taproot_inactive(), input_counts=[1, 2, 2, 2, 2, 3]) + # Run each test twice; once in isolation, and once combined with others. Testing in isolation + # means that the standardness is verified in every test (as combined transactions are only standard + # when all their inputs are standard). + self.test_spenders(self.nodes[0], spenders_taproot_inactive(), input_counts=[1]) + self.test_spenders(self.nodes[0], spenders_taproot_inactive(), input_counts=[2, 3]) if __name__ == '__main__': -- cgit v1.2.3