File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
test/functional/test_framework Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ def is_valid(v):
111111 try :
112112 payload , version = base58_to_byte (v )
113113 result = bytes ([version ]) + payload
114- except AssertionError : # thrown if checksum doesn't match
114+ except ValueError : # thrown if checksum doesn't match
115115 return is_valid_bech32 (v )
116116 for template in templates :
117117 prefix = bytearray (template [0 ])
Original file line number Diff line number Diff line change @@ -91,8 +91,8 @@ def base58_to_byte(s):
9191 break
9292 res = b'\x00 ' * pad + res
9393
94- # Assert if the checksum is invalid
95- assert_equal ( hash256 ( res [: - 4 ])[: 4 ], res [ - 4 :] )
94+ if hash256 ( res [: - 4 ])[: 4 ] != res [ - 4 :]:
95+ raise ValueError ( 'Invalid Base58Check checksum' )
9696
9797 return res [1 :- 4 ], int (res [0 ])
9898
You can’t perform that action at this time.
0 commit comments