Skip to content

Commit

Permalink
test: getspecialtxes should show correct IS/CL info
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Dec 19, 2023
1 parent 51b8886 commit 04fcd61
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/functional/feature_llmq_chainlocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ def run_test(self):
self.test_coinbase_best_cl(self.nodes[0], expected_cl_in_cb=False)

# v20 is active, no quorums, no CLs - null CL in CbTx
self.nodes[0].generate(1)
nocl_block_hash = self.nodes[0].generate(1)[0]
self.test_coinbase_best_cl(self.nodes[0], expected_cl_in_cb=True, expected_null_cl=True)
cbtx = self.nodes[0].getspecialtxes(nocl_block_hash, 5, 1, 0, 2)[0]
assert_equal(cbtx["instantlock"], False)
assert_equal(cbtx["instantlock_internal"], False)
assert_equal(cbtx["chainlock"], False)


self.nodes[0].sporkupdate("SPORK_17_QUORUM_DKG_ENABLED", 0)
self.wait_for_sporks_same()
Expand All @@ -60,6 +65,12 @@ def run_test(self):
self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash())
self.test_coinbase_best_cl(self.nodes[0])

# ChainLock locks all the blocks below it so nocl_block_hash should be locked too
cbtx = self.nodes[0].getspecialtxes(nocl_block_hash, 5, 1, 0, 2)[0]
assert_equal(cbtx["instantlock"], True)
assert_equal(cbtx["instantlock_internal"], False)
assert_equal(cbtx["chainlock"], True)

self.log.info("Mine many blocks, wait for chainlock")
self.nodes[0].generate(20)
# We need more time here due to 20 blocks being generated at once
Expand Down

0 comments on commit 04fcd61

Please sign in to comment.