Skip to content

Commit

Permalink
Merge bitcoin#18732: test: Remove unused, undocumented and misleading…
Browse files Browse the repository at this point in the history
… CScript.__add__

faff9e4 test: Remove unused, undocumented and misleading CScript.__add__ (MarcoFalke)

Pull request description:

  See the corresponding pull bitcoin#18612

ACKs for top commit:
  laanwj:
    ACK faff9e4 provided it passes Travis

Tree-SHA512: 5d9c4d5b6453c70b24a6960d3b42834e9b31f6dbb99ac47a6abfd85f2739d5372563e7188c22aceabeee1c37eb218bf580848356f4a77268d65f178a9419b269
  • Loading branch information
MarcoFalke authored and vijaydasmp committed Feb 17, 2023
1 parent 33703a5 commit 2e9fca1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
11 changes: 2 additions & 9 deletions test/functional/test_framework/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions test/functional/test_framework/script_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

0 comments on commit 2e9fca1

Please sign in to comment.