mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Merge bitcoin/bitcoin#23047: test: Use MiniWallet in mempool_persist
faae0988d6test: Check other fields are loaded correctly as well (MarcoFalke)fa4db92617test: Remove unused self.connect_nodes (MarcoFalke)fafb7b7a89test: pep8 (MarcoFalke)fa32cb2467test: Use MiniWallet in mempool_persist (MarcoFalke)faca688a85test: Add MiniWallet get_descriptor function (MarcoFalke) Pull request description: ACKs for top commit: laanwj: Code review ACKfaae0988d6Tree-SHA512: 6124f16ee1f3f416c50dc07aebe8846ff7e2b7c8e5dd84f9517cb5f1df021b9e57ed7c7e17bc099a37c663cd93f6d417c5e0622c0b359956403d53e705eb5549
This commit is contained in:
@@ -82,7 +82,7 @@ class MiniWallet:
|
||||
def rescan_utxos(self):
|
||||
"""Drop all utxos and rescan the utxo set"""
|
||||
self._utxos = []
|
||||
res = self._test_node.scantxoutset(action="start", scanobjects=[f'raw({self._scriptPubKey.hex()})'])
|
||||
res = self._test_node.scantxoutset(action="start", scanobjects=[self.get_descriptor()])
|
||||
assert_equal(True, res['success'])
|
||||
for utxo in res['unspents']:
|
||||
self._utxos.append({'txid': utxo['txid'], 'vout': utxo['vout'], 'value': utxo['amount']})
|
||||
@@ -110,12 +110,15 @@ class MiniWallet:
|
||||
|
||||
def generate(self, num_blocks):
|
||||
"""Generate blocks with coinbase outputs to the internal address, and append the outputs to the internal list"""
|
||||
blocks = self._test_node.generatetodescriptor(num_blocks, f'raw({self._scriptPubKey.hex()})')
|
||||
blocks = self._test_node.generatetodescriptor(num_blocks, self.get_descriptor())
|
||||
for b in blocks:
|
||||
cb_tx = self._test_node.getblock(blockhash=b, verbosity=2)['tx'][0]
|
||||
self._utxos.append({'txid': cb_tx['txid'], 'vout': 0, 'value': cb_tx['vout'][0]['value']})
|
||||
return blocks
|
||||
|
||||
def get_descriptor(self):
|
||||
return self._test_node.getdescriptorinfo(f'raw({self._scriptPubKey.hex()})')['descriptor']
|
||||
|
||||
def get_address(self):
|
||||
return self._address
|
||||
|
||||
|
||||
Reference in New Issue
Block a user