aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-04-22 15:49:13 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-04-22 15:49:22 -0400
commit47b94a337e1aad0c347fdfecba999b963ab51006 (patch)
tree01821f1455cc1b18f97056c55ea1d7ad33283429
parentfb89af26d8e34cf88b9383a99b794adc5336eb9c (diff)
parentfaff9e4bb431919a4bc7e4dc4a9ca188e2d18113 (diff)
downloadbitcoin-47b94a337e1aad0c347fdfecba999b963ab51006.tar.xz
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
-rwxr-xr-xtest/functional/feature_rbf.py4
-rw-r--r--test/functional/test_framework/script.py11
-rwxr-xr-xtest/functional/test_framework/script_util.py1
3 files changed, 5 insertions, 11 deletions
diff --git a/test/functional/feature_rbf.py b/test/functional/feature_rbf.py
index 9e578f0026..acf551ef69 100755
--- a/test/functional/feature_rbf.py
+++ b/test/functional/feature_rbf.py
@@ -10,7 +10,7 @@ from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut
from test_framework.script import CScript, OP_DROP
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error, satoshi_round
-from test_framework.script_util import DUMMY_P2WPKH_SCRIPT
+from test_framework.script_util import DUMMY_P2WPKH_SCRIPT, DUMMY_2_P2WPKH_SCRIPT
MAX_REPLACEMENT_LIMIT = 100
@@ -142,7 +142,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
# Should fail because we haven't changed the fee
tx1b = CTransaction()
tx1b.vin = [CTxIn(tx0_outpoint, nSequence=0)]
- tx1b.vout = [CTxOut(1 * COIN, DUMMY_P2WPKH_SCRIPT + b'a')]
+ tx1b.vout = [CTxOut(1 * COIN, DUMMY_2_P2WPKH_SCRIPT)]
tx1b_hex = txToHex(tx1b)
# This will raise an exception due to insufficient fee
diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py
index e587a77f64..016a2b4f0f 100644
--- a/test/functional/test_framework/script.py
+++ b/test/functional/test_framework/script.py
@@ -449,15 +449,8 @@ class CScript(bytes):
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 5ef67226c4..80fbae70bf 100755
--- a/test/functional/test_framework/script_util.py
+++ b/test/functional/test_framework/script_util.py
@@ -23,3 +23,4 @@ from test_framework.script import CScript
# scriptPubKeys are needed, to guarantee that the minimum transaction size is
# met.
DUMMY_P2WPKH_SCRIPT = CScript([b'a' * 21])
+DUMMY_2_P2WPKH_SCRIPT = CScript([b'b' * 21])