aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_utxo_set_hash.py
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2021-02-23 00:16:50 +0100
committerFabian Jahr <fjahr@protonmail.com>2021-03-23 20:32:50 +0100
commit4973c5175c5fd1f4791ea26e8ddefd6fb11ac1c3 (patch)
treebd6f5e2251c46d7f4d3c0194b7e0f7c8cafeda07 /test/functional/feature_utxo_set_hash.py
parent1a27af1d7b5ec18b4248ead1eaf0f381047b4b24 (diff)
downloadbitcoin-4973c5175c5fd1f4791ea26e8ddefd6fb11ac1c3.tar.xz
test: Remove wallet dependency of utxo set hash test
Diffstat (limited to 'test/functional/feature_utxo_set_hash.py')
-rwxr-xr-xtest/functional/feature_utxo_set_hash.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/functional/feature_utxo_set_hash.py b/test/functional/feature_utxo_set_hash.py
index 6e6046d84d..214dea40c4 100755
--- a/test/functional/feature_utxo_set_hash.py
+++ b/test/functional/feature_utxo_set_hash.py
@@ -6,7 +6,6 @@
import struct
-from test_framework.blocktools import create_transaction
from test_framework.messages import (
CBlock,
COutPoint,
@@ -15,15 +14,13 @@ from test_framework.messages import (
from test_framework.muhash import MuHash3072
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
+from test_framework.wallet import MiniWallet
class UTXOSetHashTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
- def skip_test_if_missing_module(self):
- self.skip_if_no_wallet()
-
def test_deterministic_hash_results(self):
self.log.info("Test deterministic UTXO set hash results")
@@ -35,18 +32,17 @@ class UTXOSetHashTest(BitcoinTestFramework):
self.log.info("Test MuHash implementation consistency")
node = self.nodes[0]
+ wallet = MiniWallet(node)
# Generate 100 blocks and remove the first since we plan to spend its
# coinbase
- block_hashes = node.generate(100)
+ block_hashes = wallet.generate(1) + node.generate(99)
blocks = list(map(lambda block: FromHex(CBlock(), node.getblock(block, False)), block_hashes))
- spending = blocks.pop(0)
+ blocks.pop(0)
# Create a spending transaction and mine a block which includes it
- tx = create_transaction(node, spending.vtx[0].rehash(), node.getnewaddress(), amount=49)
- txid = node.sendrawtransaction(hexstring=tx.serialize_with_witness().hex(), maxfeerate=0)
-
- tx_block = node.generateblock(output=node.getnewaddress(), transactions=[txid])
+ txid = wallet.send_self_transfer(from_node=node)['txid']
+ tx_block = node.generateblock(output=wallet.get_address(), transactions=[txid])
blocks.append(FromHex(CBlock(), node.getblock(tx_block['hash'], False)))
# Serialize the outputs that should be in the UTXO set and add them to