From 2e9fca13d06a03cf1d31390f80c697af5e67dcda Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 22 Apr 2020 15:49:13 -0400 Subject: [PATCH] Merge #18732: test: Remove unused, undocumented and misleading CScript.__add__ faff9e4bb431919a4bc7e4dc4a9ca188e2d18113 test: Remove unused, undocumented and misleading CScript.__add__ (MarcoFalke) Pull request description: See the corresponding pull #18612 ACKs for top commit: laanwj: ACK faff9e4bb431919a4bc7e4dc4a9ca188e2d18113 provided it passes Travis Tree-SHA512: 5d9c4d5b6453c70b24a6960d3b42834e9b31f6dbb99ac47a6abfd85f2739d5372563e7188c22aceabeee1c37eb218bf580848356f4a77268d65f178a9419b269 --- test/functional/test_framework/script.py | 11 ++--------- test/functional/test_framework/script_util.py | 1 + 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py index 253e726bbf9aa8..45e0e001eebd71 100644 --- a/test/functional/test_framework/script.py +++ b/test/functional/test_framework/script.py @@ -450,15 +450,8 @@ def __coerce_instance(cls, other): return other def __add__(self, other): - # Do the coercion outside of the try block so that errors in it are - # noticed. - other = self.__coerce_instance(other) - - try: - # bytes.__add__ always returns bytes instances unfortunately - return CScript(super(CScript, self).__add__(other)) - except TypeError: - raise TypeError('Can not add a %r instance to a CScript' % other.__class__) + # add makes no sense for a CScript() + raise NotImplementedError def join(self, iterable): # join makes no sense for a CScript() diff --git a/test/functional/test_framework/script_util.py b/test/functional/test_framework/script_util.py index d168d8989993cc..de622fe8e77f54 100755 --- a/test/functional/test_framework/script_util.py +++ b/test/functional/test_framework/script_util.py @@ -23,3 +23,4 @@ # scriptPubKeys are needed, to guarantee that the minimum transaction size is # met. DUMMY_P2SH_SCRIPT = CScript([b'a' * 22]) +DUMMY_2_P2WPKH_SCRIPT = CScript([b'b' * 22])