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):
111
111
try :
112
112
payload , version = base58_to_byte (v )
113
113
result = bytes ([version ]) + payload
114
- except AssertionError : # thrown if checksum doesn't match
114
+ except ValueError : # thrown if checksum doesn't match
115
115
return is_valid_bech32 (v )
116
116
for template in templates :
117
117
prefix = bytearray (template [0 ])
Original file line number Diff line number Diff line change @@ -91,8 +91,8 @@ def base58_to_byte(s):
91
91
break
92
92
res = b'\x00 ' * pad + res
93
93
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' )
96
96
97
97
return res [1 :- 4 ], int (res [0 ])
98
98
You can’t perform that action at this time.
0 commit comments