Persist Sapling key material in the wallet to disk

This commit is contained in:
mdr0id
2018-09-13 14:22:00 -07:00
committed by Jack Grigg
parent 1b79de781c
commit 2fcf06077f
6 changed files with 158 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ testScripts=(
'wallet_mergetoaddress.py'
'wallet.py'
'wallet_overwintertx.py'
'wallet_persistence.py'
'wallet_nullifiers.py'
'wallet_1941.py'
'wallet_addresses.py'

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env python2
# Copyright (c) 2018 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_true, start_nodes, stop_nodes, \
wait_bitcoinds
class WalletPersistenceTest (BitcoinTestFramework):
def setup_network(self, split=False):
self.nodes = start_nodes(1, self.options.tmpdir)
self.is_network_split = False
self.sync_all()
def run_test(self):
sapling_addr = self.nodes[0].z_getnewaddress('sapling')
addresses = self.nodes[0].z_listaddresses()
# make sure the node has the addresss
assert_true(sapling_addr in addresses, "Should contain address before restart")
# restart the nodes
stop_nodes(self.nodes)
wait_bitcoinds()
self.nodes = self.setup_nodes()
addresses = self.nodes[0].z_listaddresses()
# make sure we still have the address after restarting
assert_true(sapling_addr in addresses, "Should contain address after restart")
if __name__ == '__main__':
WalletPersistenceTest().main()