Page MenuHomePhabricator

[Cashtab] Tx History Pagination
Changes PlannedPublic

Authored by emack on Jan 17 2024, 11:56.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary

T1713

Paginates the tx history so users can see much further back than 10 txs.

This will make the previous approach of passing in a parsed txs array into the TxHistory component redundant, but will refactor useWallet for this in a separate diff.

Test Plan
  • npm test
  • npm start
  • pagination reflects the total txs for wallet on explorer divided by 10
  • tx history results from clicking on page 4 matches the explorer
  • send and receive XEC txs and ensure it is reflected in both wallets
  • send and receive OP_RETURN messages and ensure it is reflected in both wallets
  • send and receive eTokens and ensure it is reflected in both wallets

Diff Detail

Repository
rABC Bitcoin ABC
Branch
pagination
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26524
Build 52618: Build Diffcashtab-tests
Build 52617: arc lint + arc unit

Event Timeline

Integrated paginated tx history retrieval to the frontend rendering logic in TxHistory.js. Also added integration tests in TxHistory.test.js.

emack edited the test plan for this revision. (Show Details)

Adding chronik mock integration tests

Frontend rendering integration tests fixed. Now need to resolve the issue of no incoming txs in history.

Hooking the useEffect() loop to balances.totalBalance and nonSlpUtxostwo as additional dependencies so the paginated tx history will update itself when XEC or SLP txs are detected

emack published this revision for review.Jan 21 2024, 08:36
emack added a reviewer: bytesofman.
  • Page numbers should appear at bottom of tx history and remain visible to user during scrolling
  • perhaps need to do this diff separately and rebase -- the balance header should be fixed and remain visible as the user scrolls
cashtab/src/components/Home/TxHistory.js
80

even with the comment I don't understand what's going on here

what happens if this isn't here?

cashtab/src/components/Home/__tests__/TxHistory.test.js
196

You should be able to get the antd pagination button elements bc they have textContent of the page number

add a test to show expected behavior of user clicks on a different page

This revision now requires changes to proceed.Jan 22 2024, 12:19
emack planned changes to this revision.Mar 2 2024, 13:33
emack marked an inline comment as done.
cashtab/src/components/Home/TxHistory.js
80

If it's not there then you'll get a runtime error saying the txs variable is defined (via the input param) but not used. Removing it involves refactoring useWallet hence leaving it here for now.