예제 #1
0
 def test_encrypt_decrypt(self, mock_write):
     wallet = restore_wallet_from_text(
         'p2wpkh:L4rYY5QpfN6wJEF4SEKDpcGhTPnCe9zcGs6hiSnhpprZqVywFifN',
         path='if_this_exists_mocking_failed_648151893')['wallet']
     cmds = Commands(config=None, wallet=wallet, network=None)
     cleartext = "asdasd this is the message"
     pubkey = "021f110909ded653828a254515b58498a6bafc96799fb0851554463ed44ca7d9da"
     ciphertext = cmds.encrypt(pubkey, cleartext)
     self.assertEqual(cleartext, cmds.decrypt(pubkey, ciphertext))
예제 #2
0
 def test_encrypt_decrypt(self, mock_write):
     #wallet = restore_wallet_from_text('p2wpkh:L4rYY5QpfN6wJEF4SEKDpcGhTPnCe9zcGs6hiSnhpprZqVywFifN',
     # Converted to Namecoin using `contrib/convertAddress.py` from Namecoin Core.
     wallet = restore_wallet_from_text(
         'p2wpkh:Tm1LGU9bmMk5y8w1CAqfDfC2PzE83v6QjqVUp4odMi3aUiFsx7F5',
         path='if_this_exists_mocking_failed_648151893')['wallet']
     cmds = Commands(config=None, wallet=wallet, network=None)
     cleartext = "asdasd this is the message"
     pubkey = "021f110909ded653828a254515b58498a6bafc96799fb0851554463ed44ca7d9da"
     ciphertext = cmds.encrypt(pubkey, cleartext)
     self.assertEqual(cleartext, cmds.decrypt(pubkey, ciphertext))