HomePhabricator

[ecashaddrjs] Return address decode results ready for chronik

Description

[ecashaddrjs] Return address decode results ready for chronik

Summary:
T3063

cashaddr.decode can now return address hash as a string, which is accepted for chronik calls. However, it still returns address type in all uppercase, e.g. P2PKH. chronik-client only accepts input like p2pkh

ecashaddrjs is modified to return chronik-ready address information if a flag is passed to the cashaddr.decode function. It is handled this way to preserve backward compatibility (calling the function as it has always been called will still return the old format).

Unit tests are added for the case of chronik-ready input and output formats.

Test Plan:
Review change, unit test change, and npm test
Confirm README change makes sense

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
bytesofmanAuthored on Mar 31 2023, 17:14
bytesofmanPushed on Apr 3 2023, 17:43
Reviewer
Restricted Project
Differential Revision
D13525: [ecashaddrjs] Return address decode results ready for chronik
Parents
rABC3c6224afcb2c: Log the reason for a block policy violation
Branches
Unknown
Tags
Unknown