aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeshCollider <dobsonsa68@gmail.com>2017-11-12 19:01:15 +1300
committerMeshCollider <dobsonsa68@gmail.com>2017-12-20 18:47:56 +1300
commit68c1e00a002dd2c5982105a6fae59eac2d2ce97b (patch)
treed7f4cc57781184ba8c95cffabb26e764907b01e4
parent9e1184dd54d4b2a1d2ae590207ee5beec0d15b38 (diff)
Add test for importwallet
-rwxr-xr-xtest/functional/wallet-dump.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/wallet-dump.py b/test/functional/wallet-dump.py
index ab10e96db0..85812f9acc 100755
--- a/test/functional/wallet-dump.py
+++ b/test/functional/wallet-dump.py
@@ -126,5 +126,19 @@ class WalletDumpTest(BitcoinTestFramework):
# 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 ()