Beispiel #1
0
 def test_decode_privkey_bad_version(self):
     priv_enc = '5JnKZDMUAddiGgFjWiHNVrX5pxGcEJ1miscs2Xhy7f9BrGffrps'
     priv = '\x08' + byte_util.base58_decode(priv_enc)[1:]
     with self.assertRaises(key.Error):
         key.decode_privkey(byte_util.base58_encode(priv))
Beispiel #2
0
 def test_base58_decode_address(self):
     self.assertEquals(
         byte_util.base58_decode('1NJHiNy5CS2heskf6bx3VuHm9zjXTGdtSt'),
         key.address_from_pk_hash(
             '\xe9\x9f\xaa\x1b\x12\x8f\x13w\x8d"#\xa9\xd1\xd3~\x88\x92\x0b]B'
         ))
Beispiel #3
0
 def test_decode_privkey_checksum_mismatch(self):
     priv_enc = '5JnKZDMUAddiGgFjWiHNVrX5pxGcEJ1miscs2Xhy7f9BrGffrps'
     priv = byte_util.base58_decode(priv_enc)[:-1] + '\x42'
     with self.assertRaises(key.Error):
         key.decode_privkey(byte_util.base58_encode(priv))
Beispiel #4
0
 def test_base58_decode_zero(self):
     self.assertEquals(byte_util.base58_decode('1'), '\x00')
Beispiel #5
0
 def test_decode_privkey_bad_version(self):
     priv_enc = '5JnKZDMUAddiGgFjWiHNVrX5pxGcEJ1miscs2Xhy7f9BrGffrps'
     priv = '\x08' + byte_util.base58_decode(priv_enc)[1:]
     with self.assertRaises(key.Error):
         key.decode_privkey(byte_util.base58_encode(priv))
Beispiel #6
0
 def test_decode_privkey_checksum_mismatch(self):
     priv_enc = '5JnKZDMUAddiGgFjWiHNVrX5pxGcEJ1miscs2Xhy7f9BrGffrps'
     priv = byte_util.base58_decode(priv_enc)[:-1] + '\x42'
     with self.assertRaises(key.Error):
         key.decode_privkey(byte_util.base58_encode(priv))
Beispiel #7
0
 def test_base58_decode_address(self):
     self.assertEquals(
         byte_util.base58_decode('1NJHiNy5CS2heskf6bx3VuHm9zjXTGdtSt'),
         key.address_from_pk_hash(
             '\xe9\x9f\xaa\x1b\x12\x8f\x13w\x8d"#\xa9\xd1\xd3~\x88\x92\x0b]B'))
Beispiel #8
0
 def test_base58_decode_zero(self):
     self.assertEquals(byte_util.base58_decode('1'), '\x00')