Page MenuHomePhabricator

[Backport]test: impl. of msg_merkleblock and wait_for_merkleblock
ClosedPublic

Authored by PiRK on Sep 24 2020, 11:22.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC171445f9f225: [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

Diff Detail

Event Timeline

Owners added a reviewer: Restricted Owners Package.Sep 24 2020, 11:22
PiRK requested review of this revision.Sep 24 2020, 11:22

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Sep 24 2020, 11:46