Page MenuHomePhabricator

[Cashtab] Fix tx parsing for node upgrade
AbandonedPublic

Authored by bytesofman on Oct 21 2021, 23:40.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

Cashtab tx parsing was set up for node returning values in sats, not xec. Cashtab was also checking address conditions for bitcoincash: format returned from previous node version in bch-api; now it is getting ecash:

This diff is a patch to fix cashtab so that it works with the latest node version.

Test Plan

npm start and try sending and receiving txs. Make sure tx history parses correctly.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
tx-parse-for-ecash-node
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17098
Build 34028: Build Diffcashtab-tests
Build 34027: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Oct 22 2021, 09:28
Fabien added a subscriber: Fabien.

When I run npm start without this patch, my history is OK. With this patch, the amounts are wrong (got XEC amount with 8 decimals). How can I test with the appropriated backend ?

web/cashtab/src/components/Wallet/Tx.js
13

This function is no longer used and can be removed.

web/cashtab/src/hooks/useBCH.js
209

Is it possible to avoid the intermediate var which is not used anywhere else ? Like:

txDataWithPassThrough.address = cashaddr.encode('ecash', type, hash);
This revision now requires changes to proceed.Oct 22 2021, 09:28

After some discussion I have a better understanding of why I couldn't test it: the backend upgrade was reverted.
Since we have several backends it would also be safer to provide a smooth upgrade path, something like:
Support both legacy and ecash => upgrade all the backends => remove legacy support

This is irrelevant with chronik, will be superseded by chronik tx history parsing