Skip to content

Commit 4f2653a

Browse files
committed
test: Use deterministic chain in utxo set hash test
Also melts the previously separated test cases into one.
1 parent 4973c51 commit 4f2653a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

test/functional/feature_utxo_set_hash.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,13 @@ def set_test_params(self):
2121
self.num_nodes = 1
2222
self.setup_clean_chain = True
2323

24-
def test_deterministic_hash_results(self):
25-
self.log.info("Test deterministic UTXO set hash results")
26-
27-
# These depend on the setup_clean_chain option, the chain loaded from the cache
28-
assert_equal(self.nodes[0].gettxoutsetinfo()['hash_serialized_2'], "b32ec1dda5a53cd025b95387aad344a801825fe46a60ff952ce26528f01d3be8")
29-
assert_equal(self.nodes[0].gettxoutsetinfo("muhash")['muhash'], "dd5ad2a105c2d29495f577245c357409002329b9f4d6182c0af3dc2f462555c8")
30-
3124
def test_muhash_implementation(self):
3225
self.log.info("Test MuHash implementation consistency")
3326

3427
node = self.nodes[0]
3528
wallet = MiniWallet(node)
29+
mocktime = node.getblockheader(node.getblockhash(0))['time'] + 1
30+
node.setmocktime(mocktime)
3631

3732
# Generate 100 blocks and remove the first since we plan to spend its
3833
# coinbase
@@ -73,8 +68,11 @@ def test_muhash_implementation(self):
7368

7469
assert_equal(finalized[::-1].hex(), node_muhash)
7570

71+
self.log.info("Test deterministic UTXO set hash results")
72+
assert_equal(node.gettxoutsetinfo()['hash_serialized_2'], "5b1b44097406226c0eb8e1362cd17a1f346522cf9390a8175a57a5262cb1963f")
73+
assert_equal(node.gettxoutsetinfo("muhash")['muhash'], "4b8803075d7151d06fad3e88b68ba726886794873fbfa841d12aefb2cc2b881b")
74+
7675
def run_test(self):
77-
self.test_deterministic_hash_results()
7876
self.test_muhash_implementation()
7977

8078

0 commit comments

Comments
 (0)