From 3635d432681847313c098f9827483372a840e70f Mon Sep 17 00:00:00 2001 From: furszy Date: Sat, 19 Aug 2023 09:54:30 -0300 Subject: [PATCH] test: rpc_createmultisig, remove manual wallet initialization There is no need to manually initialize the wallets within the test case. The test framework already initializes them when `_requires_wallet` is true. --- test/functional/rpc_createmultisig.py | 2 +- test/functional/test_framework/test_framework.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/functional/rpc_createmultisig.py b/test/functional/rpc_createmultisig.py index 65d7b4c4223..a540e7730be 100755 --- a/test/functional/rpc_createmultisig.py +++ b/test/functional/rpc_createmultisig.py @@ -32,6 +32,7 @@ class RpcCreateMultiSigTest(BitcoinTestFramework): self.setup_clean_chain = True self.num_nodes = 3 self.supports_cli = False + self.enable_wallet_if_possible() def get_keys(self): self.pub = [] @@ -51,7 +52,6 @@ class RpcCreateMultiSigTest(BitcoinTestFramework): self.wallet = MiniWallet(test_node=node0) if self.is_bdb_compiled(): - self.import_deterministic_coinbase_privkeys() self.check_addmultisigaddress_errors() self.log.info('Generating blocks ...') diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index a2f767cc989..71551ffd7cb 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -444,6 +444,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): n.createwallet(wallet_name=wallet_name, descriptors=self.options.descriptors, load_on_startup=True) n.importprivkey(privkey=n.get_deterministic_priv_key().key, label='coinbase', rescan=True) + # Only enables wallet support when the module is available + def enable_wallet_if_possible(self): + self._requires_wallet = self.is_wallet_compiled() + def run_test(self): """Tests must override this method to define test logic""" raise NotImplementedError