Skip to content

Commit

Permalink
Fixed invalid testnet case
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey0xff committed Jan 10, 2020
1 parent 3e0ce75 commit 1a6fed1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion btc_validator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ def is_valid_btc_address(
):
return False

h = _base58_decode(address)
try:
h = _base58_decode(address)
except ValueError:
return False

if len(h) != 25:
return False
Expand Down
3 changes: 2 additions & 1 deletion test_btc_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def test_testnet_address(btc_address):
'',
'tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjz',
'tb1508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx',
'bc1qrp33g0q5c5txsp9arysrx4k6zdk5s4nce4xj0gdcccefvpysxf3qccfmv3'
'bc1qrp33g0q5c5txsp9arysrx4k6zdk5s4nce4xj0gdcccefvpysxf3qccfmv3',
'1A1z[1eP5QGefi2DMPTfTL5SLmv7DivfNa',
]
)
@pytest.mark.parametrize(
Expand Down

0 comments on commit 1a6fed1

Please sign in to comment.