Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated paginated deposits table #909

Merged
merged 3 commits into from
Nov 10, 2023
Merged

Conversation

dohaki
Copy link
Contributor

@dohaki dohaki commented Nov 7, 2023

Add a paginated variant of the new deposits table. Also only testable via Storybook.

Closes ACX-1623

Copy link

linear bot commented Nov 7, 2023

ACX-1623 Implement new consistent transactions table components

Designs https://www.figma.com/file/q0GREWOG7XTM0mM0brAxGn/%E2%9D%8E-Across-UI-%5BMaster%5D?type=design&node-id=6891-67146&mode=dev

Should be generic and reusable for /transactions, /referrals and /op-rebates pages.

Only implement via Storybook

Copy link

vercel bot commented Nov 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontend-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2023 8:36am
goerli-frontend-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2023 8:36am

Comment on lines 62 to 64
Math.abs(
DateTime.fromSeconds(deposit.depositTime).diffNow("seconds").as("seconds")
) > MAX_PENDING_STATE_TIME_UNTIL_SLOW;
Copy link
Contributor

@james-a-morris james-a-morris Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we allow any instance of future deposits to show in the FE? We avoid this in the relayer/SDK

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what future deposits are?

Copy link
Contributor

@james-a-morris james-a-morris Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deposits whose time occurs in the future - so when DateTime.fromSeconds(deposit.depositTime).diffNow("seconds").as("seconds") is negative

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Scraper derives the deposit date from the block timestamp of the deposit tx. So there shouldn't be cases of future deposits, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to note here is that diffNow uses the formula

DATE_ARG - NOW

i.e. if the passed-in date is in the past then it is negative. That's why I am using Math.abs here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, if we would never see future deposits, is the Math.abs(...) on the diff just for convenience?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the deposit timestamp is in the past diffNow always returns a negative number actually. Because it uses

depositTime - nowTime

That's why I need that Math.abs

Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments

Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One outstanding thread: #909 (comment)

Base automatically changed from new-deposits-table to master November 9, 2023 08:21
Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving but still curious about that Math.abs

@dohaki dohaki merged commit 468eb24 into master Nov 10, 2023
6 checks passed
@dohaki dohaki deleted the new-paginated-deposits-table branch November 10, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants