Page MenuHomePhabricator

[Cashtab] Delete function that is handled better by lib
ClosedPublic

Authored by bytesofman on Jan 24 2024, 23:36.

Details

Summary

Cashtab gets the hash160 by calling the old cashaddr library version, then converting to a legacy address to then use a different lib to extract the hash160.

We don't need to do it this way anymore, ecashaddrjs will just return it as a string.

Delete the old function and remove its associated dependency. Replace with equivalent lib method.

Test Plan

npm test
grep -r toHash160 src/ and no output
grep -r bs58 src/ and no output

Diff Detail

Repository
rABC Bitcoin ABC
Branch
master
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26635
Build 52838: Build Diffcashtab-tests
Build 52837: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jan 25 2024, 08:30
PiRK added a subscriber: PiRK.

Not directly related to this diff, but while reviewing this I noticed that D13525 didn't update the param name in the doxygen comment of the cashaddr.decode function (returnHashAsString vs chronikReady)`

In D15273#343381, @PiRK wrote:

Not directly related to this diff, but while reviewing this I noticed that D13525 didn't update the param name in the doxygen comment of the cashaddr.decode function (returnHashAsString vs chronikReady)`

good catch, D15282