Page MenuHomePhabricator

[Cashtab] [BCH deprecation] Pt 1/2 - Implement local toLegacyAddress logic
AbandonedPublic

Authored by emack on Oct 28 2022, 13:57.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary

T2370

As a prerequisite to deprecating the use of BCH.SLP.Address.toLegacyAddress in useWallet and cashMethods, this diff replicates this logic.

The bchaddrjs-slp library (659 kb) is used to convert legacy cash addresses to legacy (bitcoin) address before feeding them into the OP RETURN script generation process. This conversion is not supported by the ecashaddrjs library hence the need for this additional library.

Test Plan

npm install or npm i bchaddrjs-slp
npm test and ensure existing unit test suite passes
npm start
send a token with an OP_RETURN msg and observe the 'toLegacyAddress output from BCH-js matches bchaddrs-slp' console log message
burn a token and observe the same console log message
create a new wallet to trigger useWallet.deriveAccount() and observe the same console log message

Diff Detail

Repository
rABC Bitcoin ABC
Branch
deprecateToLegacyAddress
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20755
Build 41174: Build Diffcashtab-tests
Build 41173: arc lint + arc unit

Event Timeline

emack requested review of this revision.Oct 28 2022, 13:57

To be resubmitted using the more efficient base58 (see D12395) rather than a 600kb library