Merge bitcoin/bitcoin#24587: test: use MiniWallet for rpc_createmultisig.py

2726b60a3a test: use MiniWallet for rpc_createmultisig.py (Ayush Sharma)

Pull request description:

  This PR enables one of the non-wallet functional tests (rpc_createmultisig.py) to be run even with the Bitcoin Core wallet disabled by using the MiniWallet instead, as proposed in #20078 .

ACKs for top commit:
  danielabrozzoni:
    re-ACK 2726b60a3a

Tree-SHA512: fb0ef22d3f1c161ca5963cb19ce76533ac3941f15102fc0aa2286ef3bec48f219e5934d504b41976f9f295fb6ca582b737e0fea896df4eb964cdaba1b2c91650
This commit is contained in:
fanquake
2022-03-24 10:58:49 +00:00
3 changed files with 62 additions and 45 deletions

View File

@@ -96,6 +96,9 @@ class MiniWallet:
self._address, self._internal_key = create_deterministic_address_bcrt1_p2tr_op_true()
self._scriptPubKey = bytes.fromhex(self._test_node.validateaddress(self._address)['scriptPubKey'])
def get_balance(self):
return sum(u['value'] for u in self._utxos)
def rescan_utxos(self):
"""Drop all utxos and rescan the utxo set"""
self._utxos = []