test: Cleanups to ZIP 221 Python test code
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
a18f8b58a9
commit
92d6984842
|
@ -9,8 +9,8 @@ from test_framework.mininode import (CBlockHeader)
|
||||||
from test_framework.test_framework import BitcoinTestFramework
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.util import (
|
from test_framework.util import (
|
||||||
BLOSSOM_BRANCH_ID,
|
BLOSSOM_BRANCH_ID,
|
||||||
CANOPY_BRANCH_ID,
|
|
||||||
HEARTWOOD_BRANCH_ID,
|
HEARTWOOD_BRANCH_ID,
|
||||||
|
CANOPY_BRANCH_ID,
|
||||||
NU5_BRANCH_ID,
|
NU5_BRANCH_ID,
|
||||||
assert_equal,
|
assert_equal,
|
||||||
bytes_to_hex_str,
|
bytes_to_hex_str,
|
||||||
|
|
|
@ -32,9 +32,10 @@ class ZcashMMRNode():
|
||||||
nEarliestHeight: int
|
nEarliestHeight: int
|
||||||
nLatestHeight: int
|
nLatestHeight: int
|
||||||
nSaplingTxCount: int # number of Sapling transactions in block
|
nSaplingTxCount: int # number of Sapling transactions in block
|
||||||
hashEarliestOrchardRoot: bytes # left child's Orchard root
|
# NU5 only.
|
||||||
hashLatestOrchardRoot: bytes # right child's Orchard root
|
hashEarliestOrchardRoot: Optional[bytes] # left child's Orchard root
|
||||||
nOrchardTxCount: int # number of Orchard transactions in block
|
hashLatestOrchardRoot: Optional[bytes] # right child's Orchard root
|
||||||
|
nOrchardTxCount: Optional[int] # number of Orchard transactions in block
|
||||||
|
|
||||||
consensusBranchId: bytes
|
consensusBranchId: bytes
|
||||||
|
|
||||||
|
@ -116,10 +117,10 @@ def make_parent(
|
||||||
parent.nSaplingTxCount = left_child.nSaplingTxCount + right_child.nSaplingTxCount
|
parent.nSaplingTxCount = left_child.nSaplingTxCount + right_child.nSaplingTxCount
|
||||||
parent.hashEarliestOrchardRoot = left_child.hashEarliestOrchardRoot
|
parent.hashEarliestOrchardRoot = left_child.hashEarliestOrchardRoot
|
||||||
parent.hashLatestOrchardRoot = right_child.hashLatestOrchardRoot
|
parent.hashLatestOrchardRoot = right_child.hashLatestOrchardRoot
|
||||||
parent.nOrchardTxCount = \
|
parent.nOrchardTxCount = (
|
||||||
left_child.nOrchardTxCount + right_child.nOrchardTxCount \
|
left_child.nOrchardTxCount + right_child.nOrchardTxCount
|
||||||
if left_child.nOrchardTxCount is not None and right_child.nOrchardTxCount is not None \
|
if left_child.nOrchardTxCount is not None and right_child.nOrchardTxCount is not None
|
||||||
else None
|
else None)
|
||||||
parent.consensusBranchId = left_child.consensusBranchId
|
parent.consensusBranchId = left_child.consensusBranchId
|
||||||
return parent
|
return parent
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue