aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/wallet.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-09-12 11:03:56 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-09-12 12:13:58 +0200
commitfac66d0a39cb0b4bc565b57087ba84dd932e9b6d (patch)
tree09620ee11e4341d746599da50679488c343d2d4d /test/functional/test_framework/wallet.py
parent053a5fc7d912d597cd6dc7376b479420d1eae1c0 (diff)
test: Simplify p2p_blocksonly test with new miniwallet rescan_utxos method
Diffstat (limited to 'test/functional/test_framework/wallet.py')
-rw-r--r--test/functional/test_framework/wallet.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py
index ba5b95f930..08086bc0b9 100644
--- a/test/functional/test_framework/wallet.py
+++ b/test/functional/test_framework/wallet.py
@@ -79,6 +79,14 @@ class MiniWallet:
self._address = ADDRESS_BCRT1_P2WSH_OP_TRUE
self._scriptPubKey = bytes.fromhex(self._test_node.validateaddress(self._address)['scriptPubKey'])
+ 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()})'])
+ assert_equal(True, res['success'])
+ for utxo in res['unspents']:
+ self._utxos.append({'txid': utxo['txid'], 'vout': utxo['vout'], 'value': utxo['amount']})
+
def scan_blocks(self, *, start=1, num):
"""Scan the blocks for self._address outputs and add them to self._utxos"""
for i in range(start, start + num):