test_base58: added tests for a single character, zero and invalid data

This commit is contained in:
Dmitri Bogomolov 2021-11-03 17:14:18 +02:00
parent 8a5d90f200
commit 93c7cfbf63
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -46,11 +46,15 @@ class TestAddresses(unittest.TestCase):
def test_base58(self):
"""Check Base58 encoding and decoding"""
self.assertEqual(addresses.decodeBase58('1'), 0)
self.assertEqual(addresses.decodeBase58('!'), 0)
self.assertEqual(
addresses.decodeBase58(sample_addr4), sample_daddr4_512)
self.assertEqual(
addresses.decodeBase58(sample_addr3), sample_daddr3_512)
self.assertEqual(addresses.encodeBase58(0), '1')
self.assertEqual(addresses.encodeBase58(-1), None)
self.assertEqual(
sample_addr4, addresses.encodeBase58(sample_daddr4_512))
self.assertEqual(