This is continuing the work from D11117 to remove the test framework assumptions about the proof format. This diff attempts to deserialize the p2p messages with the new format, and fallback to the legacy format if it fails. This makes the event callback work with both the new and legacy formats, and the test can still check the type match expectation if needed. The correct fallback handling is demonstrated by the tests still passing.
Details
Details
- Reviewers
PiRK - Group Reviewers
Restricted Project - Commits
- rABCb12a12c17154: [avalanche] Test framework: don't assume the p2p avaproof messages are using…
ninja check-functional-extended
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Note that this assumes that a msg_avaproof instance is only used once, or at the very least is always reused with the same proof type, which seems like a reasonable assumption. It would fail if someone tried something crazy like deserializing a LegacyAvalancheProof first, then an AvalancheProof second because self.proof is not reset.