Test RandomX getblocktemplate proposal validation

This commit is contained in:
Capri 2026-09-16 23:23:55 +00:00
commit 223d111aff
Signed by: VextaProject
SSH key fingerprint: SHA256:739BZv8LvIDY2tR7lXLy/IQ6MaGTQtYcG9GNvCjmpVM

View file

@ -370,6 +370,25 @@ class RandomXGetBlockTemplateTest(DigiByteTestFramework):
assert_equal(submit_node.getblockcount(), 0) assert_equal(submit_node.getblockcount(), 0)
self.log.info("RandomX GBT proposal mode accepts a valid RandomX block")
randomx_proposal_hash = node.getblockhash(1)
randomx_proposal_block = node.getblock(randomx_proposal_hash, 0)
assert_equal(
submit_node.getblocktemplate(
{
"data": randomx_proposal_block,
"mode": "proposal",
"rules": ["segwit"],
},
"randomx",
),
None,
)
# Proposal validation must not add the block to the active chain.
assert_equal(submit_node.getblockcount(), 0)
self.log.info("Submit the mixed SHA256D and RandomX headers first") self.log.info("Submit the mixed SHA256D and RandomX headers first")
for height in range(1, 7): for height in range(1, 7):
block_hash = node.getblockhash(height) block_hash = node.getblockhash(height)