aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-05-09 23:22:27 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-05-10 01:31:27 +0200
commit2eca46b0aa0ecf4738500b53523d7013985b387d (patch)
tree4b2c7ed708c142c3e908c67c00d955326f167c4a /test/functional/test_framework
parent9313c4e6aa4b707c06a86b33d5d2753cd8383340 (diff)
downloadbitcoin-2eca46b0aa0ecf4738500b53523d7013985b387d.tar.xz
test: use MiniWallet for feature_csv_activation.py
This test can now be run even with the Bitcoin Core wallet disabled.
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r--test/functional/test_framework/wallet.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py
index 395b50c4d8..57b0a170f0 100644
--- a/test/functional/test_framework/wallet.py
+++ b/test/functional/test_framework/wallet.py
@@ -61,7 +61,7 @@ class MiniWallet:
def get_address(self):
return self._address
- def get_utxo(self, *, txid=''):
+ def get_utxo(self, *, txid='', mark_as_spent=True):
"""
Returns a utxo and marks it as spent (pops it from the internal list)
@@ -74,7 +74,10 @@ class MiniWallet:
if txid:
utxo = next(filter(lambda utxo: txid == utxo['txid'], self._utxos))
index = self._utxos.index(utxo)
- return self._utxos.pop(index)
+ if mark_as_spent:
+ return self._utxos.pop(index)
+ else:
+ return self._utxos[index]
def send_self_transfer(self, *, fee_rate=Decimal("0.003"), from_node, utxo_to_spend=None):
"""Create and send a tx with the specified fee_rate. Fee may be exact or at most one satoshi higher than needed."""