HomePhabricator

[Backport]test: impl. of msg_merkleblock and wait_for_merkleblock

Description

[Backport]test: impl. of msg_merkleblock and wait_for_merkleblock

Summary:
Implements the missing initialization/serialization methods for
msg_merkleblock, based on the already present class CMerkleBlock.
Also changes the method wait_for_merkleblock() to be more precise by waiting
for a merkleblock with a specified blockhash instead of an arbitrary one.

In the BIP37 test p2p_filter.py, this new method is used to make the test of
receiving merkleblock and tx if a filter is set to be more precise, by checking
if they also arrive in the right order.

The interfaces for the methods wait_for_header() and wait_for_merkleblock() are
changed to take a hex string instead of an integer, improving type safety and
removing the burden from the caller to always do the transformation via
int(...). As suggested by MarcoFalke in
https://github.com/bitcoin/bitcoin/pull/18593#discussion_r407062253

This is a backport of Bitcoin Core PR18593

Test Plan: ninja check-functional

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

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

Details

Provenance
Sebastian Falbesoner <sebastian.falbesoner@gmail.com>Authored on Apr 10 2020, 14:01
PiRKCommitted on Sep 24 2020, 12:02
PiRKPushed on Sep 24 2020, 12:02
Reviewer
Restricted Owners Package
Differential Revision
D7548: [Backport]test: impl. of msg_merkleblock and wait_for_merkleblock
Parents
rABC93237957b817: [backport#19041] ci: tsan with -stdlib=libc++-10
Branches
Unknown
Tags
Unknown