Exemple #1
0
 def test_get_private_key(self):
     seed = 'ee6ea9eceaf649640051a4c305ac5c59'
     keystore = Old_KeyStore.from_seed(seed)
     result = keystore.get_private_key((False, 10), None)
     assert result == (bytes.fromhex(
         '81279e4fe405363eb56e686726d450fe4a76a1d83b64311d7618b845683aab4a'
     ), False)
Exemple #2
0
 def test_get_seed(self):
     seed = 'ee6ea9eceaf649640051a4c305ac5c59'
     keystore = Old_KeyStore.from_seed(seed)
     password = '******'
     keystore.update_password(password)
     assert keystore.get_seed(password) == ('duck pattern possibly awaken utter roam sail '
                                            'couple curve travel treat lord')
     with pytest.raises(AssertionError):
         keystore.update_password('', password)
Exemple #3
0
 def test_get_seed(self):
     seed = 'ee6ea9eceaf649640051a4c305ac5c59'
     keystore = Old_KeyStore.from_seed(seed)
     password = '******'
     keystore.update_password(None, password)
     assert keystore.get_seed(password) == ('duck pattern possibly awaken utter roam sail '
                                            'couple curve travel treat lord')
     keystore.update_password(password, '')
     assert keystore.get_seed(None) == ('duck pattern possibly awaken utter roam sail '
                                        'couple curve travel treat lord')
    def multisig_keystores(self):
        seed = 'ee6ea9eceaf649640051a4c305ac5c59'
        keystore1 = Old_KeyStore.from_seed(seed)

        xprv = ('xprv9s21ZrQH143K4XLpSd2berkCzJTXDv68rusDQFiQGSqa1ZmVXnYzYpTQ9'
                'qYiSB7mHvg6kEsrd2ZtnHRJ61sZhSN4jZ2T8wxA4T75BE4QQZ1')
        xpub = ('xpub661MyMwAqRbcH1RHYeZc1zgwYLJ1dNozE8npCe81pnNYtN6e5KsF6cmt17Fv8w'
                'GvJrRiv6Kewm8ggBG6N3XajhoioH3stUmLRi53tk46CiA')
        keystore2 = BIP32_KeyStore({'xprv': xprv, 'xpub': xpub})

        return [keystore1, keystore2]
Exemple #5
0
 def test_check_seed(self):
     seed = 'ee6ea9eceaf649640051a4c305ac5c59'
     keystore = Old_KeyStore.from_seed(seed)
     keystore.check_seed(seed.encode())
     with pytest.raises(InvalidPassword):
         keystore.check_seed(b'foo')
Exemple #6
0
 def test_get_pubkey_from_mpk(self, args, pubkey):
     assert Old_KeyStore.get_pubkey_from_mpk(*args) == pubkey
Exemple #7
0
 def test_get_pubkey_from_mpk(self, args, pubkey_hex):
     pubkey = Old_KeyStore.get_pubkey_from_mpk(*args)
     assert pubkey.to_hex() == pubkey_hex