Пример #1
0
    def test_encrypt_decrypt(self):
        
        # Roundtrip clear -> enc -> clear
        pw = 'testpassword'
        encr_privkey = bitcoinista.encrypt_privkey(self.private_key, pw)
        decrypted_privkey = bitcoinista.decrypt_privkey(encr_privkey, pw)

        self.assertNotEqual(encr_privkey, self.private_key)
        self.assertEqual(decrypted_privkey, self.private_key)
Пример #2
0
    def test_encrypt_decrypt(self):

        # Roundtrip clear -> enc -> clear
        pw = 'testpassword'
        encr_privkey = bitcoinista.encrypt_privkey(self.private_key, pw)
        decrypted_privkey = bitcoinista.decrypt_privkey(encr_privkey, pw)

        self.assertNotEqual(encr_privkey, self.private_key)
        self.assertEqual(decrypted_privkey, self.private_key)
Пример #3
0
    def test_wallet_file(self):
        
        filename = 'testing_wallet.json'

        pw = 'testpassword'
        encr_privkey = bitcoinista.encrypt_privkey(self.private_key, pw)
        
        bitcoinista.create_wallet_file(filename, encr_privkey, self.addr)
        encr_privkey2, addr2 = bitcoinista.read_from_wallet_file(filename)

        self.assertEqual(encr_privkey, encr_privkey2)
        self.assertEqual(self.addr, addr2)
        
        os.remove(filename)
Пример #4
0
    def test_wallet_file(self):

        filename = 'testing_wallet.json'

        pw = 'testpassword'
        encr_privkey = bitcoinista.encrypt_privkey(self.private_key, pw)

        bitcoinista.create_wallet_file(filename, encr_privkey, self.addr)
        encr_privkey2, addr2 = bitcoinista.read_from_wallet_file(filename)

        self.assertEqual(encr_privkey, encr_privkey2)
        self.assertEqual(self.addr, addr2)

        os.remove(filename)