HomePhabricator

[backport#16865] test: add some unit tests for merkle.cpp

Description

[backport#16865] test: add some unit tests for merkle.cpp

Summary:
following situations are covered:

  • empty block
  • one Tx
  • Merkle root of a block with odd Txs should not change with repeating

last one

  • Merkle root is computed with combining Merkle root of left subtree and right subtree

Signed-off-by: soroosh-sdi <soroosh.sardari@gmail.com>

Backport of Core PR16865

Test Plan: ninja && ninja check

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8017

Details

Provenance
soroosh-sdi <soroosh.sardari@gmail.com>Authored on Oct 21 2020, 12:21
PiRKCommitted on Oct 21 2020, 12:21
abc-botPushed on Oct 21 2020, 12:27
Reviewer
Restricted Owners Package
Differential Revision
D8017: [backport#16865] test: add some unit tests for merkle.cpp
Parents
rABC99b8f5ba2cc0: util: Add SetupHelpOptions()
Branches
Unknown
Tags
Unknown