Page MenuHomePhabricator

[Cashtab] Add tx history
ClosedPublic

Authored by josephroyking on Mar 18 2021, 00:32.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC806cda77e068: [Cashtab] Add tx history
Summary

Add tx history to main wallet screen for the 10 most-recent confirmed transactions.

This ended up being a large diff. Data from available API had to be manipulated in specific ways to be suited for processing tx history. However, it's still only one feature, and a barebones version (does not process token txs, does not process unconfirmed txs, does not update as txs are sent or received -- features will be added in future diffs).

Unit tests and mocks are added for new functions. Although several files are changed, the only change from the user's perspective is seeing transaction history on the main screen.

Test Plan

npm test

Diff Detail

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

Event Timeline

Fabien requested changes to this revision.Mar 18 2021, 09:55
Fabien added a subscriber: Fabien.
Fabien added inline comments.
web/cashtab/src/components/Wallet/TxHistory.js
17 ↗(On Diff #27952)
web/cashtab/src/hooks/useBCH.js
25 ↗(On Diff #27952)

nit: layout

45 ↗(On Diff #27952)

?

131 ↗(On Diff #27952)

remove

This revision now requires changes to proceed.Mar 18 2021, 09:56

Resolving comments. Keeping explorer.be.cash for now though because it parses token txs.

web/cashtab/src/components/Wallet/TxHistory.js
17 ↗(On Diff #27952)

explorer.be.cash parses token transactions, so I think it's necessary to default there for now. This tx history feature currently only parses token transactions as "Sent or Received token transaction", so an explorer that says token quantity and ID is I think necessary.

Handle unconfirmed txs, remove redundant txHistory prop and instead only use parsedTxHistory to check if wallet is new

This revision is now accepted and ready to land.Mar 19 2021, 15:58