Page MenuHomePhabricator

[Cashtab] [BCH Deprecation] [HD Node] Pt 2/3 - Localize downstream logic from new masterHDNode
ClosedPublic

Authored by emack on Nov 9 2022, 14:32.

Details

Summary

T2730

Depends on D12414

This is part 2 of the 3 part diff to deprecate the use of the BCH.HDNode object, using the newly created masterHDNode object from part 1 for the downstream parameters such as derivePath, toPublicKey, toCashAddress and toWIF.

Pt 1/3 - Implement separate masterHDNode creation logic
Pt 2/3 - Localize downstream logic from masterHDNode (add and compare local outputs for derivePath, toPublicKey, toCashaddress & toWIF)
Pt 3/3 - Deprecate BCH.HDNode (fromSeed, derivePath, toPublicKey, toCashAddress & toWIF)

Test Plan

npm test

  • npm start
  • create a new wallet
  • note the following comparison logs (Path245, Path145 & Path1899 derivation paths)

Path245: derivePath() outputs match
Path245: getPublicKeyBuffer() output match
Path245: legacyToLegacyCash() output match
Path245: toWIF() output match

Path145: derivePath() outputs match
Path145: getPublicKeyBuffer() output match
Path145: legacyToLegacyCash() output match
Path145: toWIF() output match

Path1899: derivePath() outputs match
Path1899: getPublicKeyBuffer() output match
Path1899: legacyToLegacyCash() output match
Path1899: toWIF() output match

Diff Detail

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

Event Timeline

emack requested review of this revision.Nov 9 2022, 14:32

updated localNode references

extracting cash address via the hash160 buffer from the node object

This revision is now accepted and ready to land.Nov 10 2022, 09:50