MCPcopy
hub / github.com/jimmysong/programmingbitcoin / test_base58

Method test_base58

code-ch13/helper.py:306–312  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

304 self.assertEqual(int_to_little_endian(n, 8), want)
305
306 def test_base58(self):
307 addr = 'mnrVtF8DWjMu839VW3rBfgYaAfKk8983Xf'
308 h160 = decode_base58(addr).hex()
309 want = '507b27411ccf7f16f10297de6cef3f291623eddf'
310 self.assertEqual(h160, want)
311 got = encode_base58_checksum(b'\x6f' + bytes.fromhex(h160))
312 self.assertEqual(got, addr)
313
314 def test_p2pkh_address(self):
315 h160 = bytes.fromhex('74d691da1574e6b3c192ecfb52cc8984ee7b6c56')

Callers

nothing calls this directly

Calls 3

decode_base58Function · 0.70
encode_base58_checksumFunction · 0.70
hexMethod · 0.45

Tested by

no test coverage detected