From a7f9365fb8686175c14a8c4616e9509e7772ccd6 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 18 Nov 2020 11:12:09 +0000 Subject: [PATCH] test: Set hashFinalSaplingRoot default correctly in create_block --- qa/rpc-tests/test_framework/blocktools.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qa/rpc-tests/test_framework/blocktools.py b/qa/rpc-tests/test_framework/blocktools.py index 123ef5bdf..d3f06f479 100644 --- a/qa/rpc-tests/test_framework/blocktools.py +++ b/qa/rpc-tests/test_framework/blocktools.py @@ -16,8 +16,10 @@ def create_block(hashprev, coinbase, nTime=None, nBits=None, hashFinalSaplingRoo else: block.nTime = nTime block.hashPrevBlock = hashprev - if hashFinalSaplingRoot is not None: - block.hashFinalSaplingRoot = hashFinalSaplingRoot + if hashFinalSaplingRoot is None: + # By default NUs up to Sapling are active from block 1, so we set this to the empty root. + hashFinalSaplingRoot = 0x3e49b5f954aa9d3545bc6c37744661eea48d7c34e3000d82b7f0010c30f4c2fb + block.hashFinalSaplingRoot = hashFinalSaplingRoot if nBits is None: block.nBits = 0x200f0f0f # difficulty retargeting is disabled in REGTEST chainparams else: