Page MenuHomePhabricator

Make descriptor test deterministic
ClosedPublic

Authored by Fabien on Aug 18 2020, 08:40.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC833f4496bb6b: Make descriptor test deterministic
Summary
Changed MaybeUseHInsteadOfApostrophy to UseHInsteadOfApostrophe.
This function now always replaces apostrophes with 'h'.
The original Check function was renamed to DoCheck and it's
called with an additional parameter which tells it to either
leave the prv and pub arguments as is or replace the apostrophes
with 'h'. The test runs with apostrophes replaced in prv only,
pub only, prv and pub and without replacement at all. Replacement
of apostrophes in a descriptor and then running DoCheck is conditional
on whether apostrophes are found in that descriptor.

Additionally, instead of dropping the checksum recalculate it
after replacing apostrophes with 'h' in the function
UseHInsteadOfApostrophe
using the GetDescriptorChecksum function. That way, this also
introduces an indirect unit test to GetDescriptoChecksum.

Backport of core PR16570.

Test Plan
ninja check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Aug 18 2020, 08:40

[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.Aug 18 2020, 09:56
This revision was automatically updated to reflect the committed changes.