aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_avoidreuse.py
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2022-04-14 14:40:06 -0400
committerAndrew Chow <achow101-github@achow101.com>2022-04-14 14:42:34 -0400
commit88376c623cff3602d04ec6c94a89552aefa20fa7 (patch)
treed71040e971e359530c60a0083261272807593cfc /test/functional/wallet_avoidreuse.py
parent17ab31aa46f7b5c265d07091fe45671ef2af6a9a (diff)
test: Test for disabling wallet flags
Diffstat (limited to 'test/functional/wallet_avoidreuse.py')
-rwxr-xr-xtest/functional/wallet_avoidreuse.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/wallet_avoidreuse.py b/test/functional/wallet_avoidreuse.py
index dc823c2c60..f663666f57 100755
--- a/test/functional/wallet_avoidreuse.py
+++ b/test/functional/wallet_avoidreuse.py
@@ -118,6 +118,17 @@ class AvoidReuseTest(BitcoinTestFramework):
assert_raises_rpc_error(-8, "Wallet flag is already set to false", self.nodes[0].setwalletflag, 'avoid_reuse', False)
assert_raises_rpc_error(-8, "Wallet flag is already set to true", self.nodes[1].setwalletflag, 'avoid_reuse', True)
+ # Create a wallet with avoid reuse, and test that disabling it afterwards persists
+ self.nodes[1].createwallet(wallet_name="avoid_reuse_persist", avoid_reuse=True)
+ w = self.nodes[1].get_wallet_rpc("avoid_reuse_persist")
+ assert_equal(w.getwalletinfo()["avoid_reuse"], True)
+ w.setwalletflag("avoid_reuse", False)
+ assert_equal(w.getwalletinfo()["avoid_reuse"], False)
+ w.unloadwallet()
+ self.nodes[1].loadwallet("avoid_reuse_persist")
+ assert_equal(w.getwalletinfo()["avoid_reuse"], False)
+ w.unloadwallet()
+
def test_immutable(self):
'''Test immutable wallet flags'''
self.log.info("Test immutable wallet flags")