Skip to content

Commit

Permalink
Add test for importwallet
Browse files Browse the repository at this point in the history
  • Loading branch information
meshcollider committed Dec 20, 2017
1 parent 9e1184d commit 68c1e00
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/functional/wallet-dump.py
Expand Up @@ -126,5 +126,19 @@ def run_test (self):
# Overwriting should fail
assert_raises_rpc_error(-8, "already exists", self.nodes[0].dumpwallet, tmpdir + "/node0/wallet.unencrypted.dump")

# Restart node with new wallet, and test importwallet
self.stop_node(0)
self.start_node(0, ['-wallet=w2'])

# Make sure the address is not IsMine before import
result = self.nodes[0].validateaddress(multisig_addr)
assert(result['ismine'] == False)

self.nodes[0].importwallet(os.path.abspath(tmpdir + "/node0/wallet.unencrypted.dump"))

# Now check IsMine is true
result = self.nodes[0].validateaddress(multisig_addr)
assert(result['ismine'] == True)

if __name__ == '__main__':
WalletDumpTest().main ()

0 comments on commit 68c1e00

Please sign in to comment.