Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_encryption.py
Show All 26 Lines | def run_test(self): | ||||
# Make sure the wallet isn't encrypted first | # Make sure the wallet isn't encrypted first | ||||
address = self.nodes[0].getnewaddress() | address = self.nodes[0].getnewaddress() | ||||
privkey = self.nodes[0].dumpprivkey(address) | privkey = self.nodes[0].dumpprivkey(address) | ||||
assert_equal(privkey[:1], "c") | assert_equal(privkey[:1], "c") | ||||
assert_equal(len(privkey), 52) | assert_equal(len(privkey), 52) | ||||
# Encrypt the wallet | # Encrypt the wallet | ||||
self.nodes[0].node_encrypt_wallet(passphrase) | self.nodes[0].encryptwallet(passphrase) | ||||
self.start_node(0) | |||||
# Check the encrypted wallet is marked as locked on initialization | # Check the encrypted wallet is marked as locked on initialization | ||||
assert_equal(self.nodes[0].getwalletinfo()['unlocked_until'], 0) | assert_equal(self.nodes[0].getwalletinfo()['unlocked_until'], 0) | ||||
# Test that the wallet is encrypted | # Test that the wallet is encrypted | ||||
assert_raises_rpc_error( | assert_raises_rpc_error( | ||||
-13, "Please enter the wallet passphrase with walletpassphrase first", | -13, "Please enter the wallet passphrase with walletpassphrase first", | ||||
self.nodes[0].dumpprivkey, address) | self.nodes[0].dumpprivkey, address) | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |