Run dumpwallet for legacy wallets only in wallet_backup.py

Descriptor wallets don't support dumpwallet, so make the tests that do
dumpwallet legacy wallet only.
This commit is contained in:
Andrew Chow 2020-04-03 18:49:36 -04:00
parent 6c6639ac9f
commit 310b0fde04
2 changed files with 24 additions and 20 deletions

View File

@ -88,6 +88,7 @@ BASE_SCRIPTS = [
'wallet_hd.py', 'wallet_hd.py',
'wallet_hd.py --descriptors', 'wallet_hd.py --descriptors',
'wallet_backup.py', 'wallet_backup.py',
'wallet_backup.py --descriptors',
# vv Tests less than 5m vv # vv Tests less than 5m vv
'mining_getblocktemplate_longpoll.py', 'mining_getblocktemplate_longpoll.py',
'feature_maxuploadtarget.py', 'feature_maxuploadtarget.py',

View File

@ -135,10 +135,12 @@ class WalletBackupTest(BitcoinTestFramework):
self.log.info("Backing up") self.log.info("Backing up")
self.nodes[0].backupwallet(os.path.join(self.nodes[0].datadir, 'wallet.bak')) self.nodes[0].backupwallet(os.path.join(self.nodes[0].datadir, 'wallet.bak'))
self.nodes[0].dumpwallet(os.path.join(self.nodes[0].datadir, 'wallet.dump'))
self.nodes[1].backupwallet(os.path.join(self.nodes[1].datadir, 'wallet.bak')) self.nodes[1].backupwallet(os.path.join(self.nodes[1].datadir, 'wallet.bak'))
self.nodes[1].dumpwallet(os.path.join(self.nodes[1].datadir, 'wallet.dump'))
self.nodes[2].backupwallet(os.path.join(self.nodes[2].datadir, 'wallet.bak')) self.nodes[2].backupwallet(os.path.join(self.nodes[2].datadir, 'wallet.bak'))
if not self.options.descriptors:
self.nodes[0].dumpwallet(os.path.join(self.nodes[0].datadir, 'wallet.dump'))
self.nodes[1].dumpwallet(os.path.join(self.nodes[1].datadir, 'wallet.dump'))
self.nodes[2].dumpwallet(os.path.join(self.nodes[2].datadir, 'wallet.dump')) self.nodes[2].dumpwallet(os.path.join(self.nodes[2].datadir, 'wallet.dump'))
self.log.info("More transactions") self.log.info("More transactions")
@ -183,6 +185,7 @@ class WalletBackupTest(BitcoinTestFramework):
assert_equal(self.nodes[1].getbalance(), balance1) assert_equal(self.nodes[1].getbalance(), balance1)
assert_equal(self.nodes[2].getbalance(), balance2) assert_equal(self.nodes[2].getbalance(), balance2)
if not self.options.descriptors:
self.log.info("Restoring using dumped wallet") self.log.info("Restoring using dumped wallet")
self.stop_three() self.stop_three()
self.erase_three() self.erase_three()