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.
This commit is contained in:
furszy 2023-08-19 09:54:30 -03:00
parent f5b6f621ff
commit 3635d43268
No known key found for this signature in database
GPG Key ID: 5DD23CCC686AA623
2 changed files with 5 additions and 1 deletions

View File

@ -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 ...')

View File

@ -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