diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-04-05 20:04:20 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-04-05 20:07:33 +0200 |
commit | 65c49ac750ba39801b349d0a59c27471dfa9868e (patch) | |
tree | 594b34981ecee869733d159a3e0ea759d64b5f9d /test | |
parent | 219d2c7ee1d35a353a96c55d4c411d43fe39548a (diff) | |
download | bitcoin-65c49ac750ba39801b349d0a59c27471dfa9868e.tar.xz |
test: throw `ValueError` for invalid base58 checksum
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/test_framework/address.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/test_framework/address.py b/test/functional/test_framework/address.py index 9ac3f847b7..fcea24655b 100644 --- a/test/functional/test_framework/address.py +++ b/test/functional/test_framework/address.py @@ -91,8 +91,8 @@ def base58_to_byte(s): break res = b'\x00' * pad + res - # Assert if the checksum is invalid - assert_equal(hash256(res[:-4])[:4], res[-4:]) + if hash256(res[:-4])[:4] != res[-4:]: + raise ValueError('Invalid Base58Check checksum') return res[1:-4], int(res[0]) |