Test multi-algo GBT cache switching

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

View file

@ -156,6 +156,24 @@ class RandomXGetBlockTemplateTest(DigiByteTestFramework):
assert "randomx_seed_height" not in sha_template assert "randomx_seed_height" not in sha_template
assert "randomx_seed" not in sha_template assert "randomx_seed" not in sha_template
self.log.info("GBT cache switches cleanly back to RandomX")
randomx_template_again = node.getblocktemplate(
NORMAL_GBT_REQUEST_PARAMS,
"randomx",
)
assert_equal(randomx_template_again["height"], 1)
assert_equal(
randomx_template_again["version"] & BLOCK_VERSION_ALGO,
BLOCK_VERSION_RANDOMX,
)
assert_equal(randomx_template_again["pow_algo_id"], 1)
assert_equal(randomx_template_again["pow_algo"], "randomx")
assert_equal(randomx_template_again["randomx_seed_height"], 0)
assert_equal(
randomx_template_again["randomx_seed"],
expected_randomx_seed,
)
self.log.info("Mining RPC exposes SHA256D and RandomX at activation") self.log.info("Mining RPC exposes SHA256D and RandomX at activation")
mining_info = node.getmininginfo() mining_info = node.getmininginfo()
assert_equal(set(mining_info["difficulties"]), {"sha256d", "randomx"}) assert_equal(set(mining_info["difficulties"]), {"sha256d", "randomx"})