HomePhabricator

net: Use mockable time for ping/pong, add tests

Description

net: Use mockable time for ping/pong, add tests

Summary:

Switch CNode::m_ping_start and CNetMessage::m_time to mockable time, so
that tests can be added.

Mockable time is also type-safe, since it uses std::chrono

Backport of core PR18638.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on May 24 2020, 12:19
FabienCommitted on Feb 3 2021, 10:31
FabienPushed on Feb 3 2021, 10:33
Reviewer
Restricted Project
Differential Revision
D9129: net: Use mockable time for ping/pong, add tests
Parents
rABC318e0b08c124: [Cashtab] Adding stub dev docs with facebook docusaurus
Branches
Unknown
Tags
Unknown