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

[explorer] Rebuild transactions for address and object #9852

Merged

Conversation

Jordan-Mysten
Copy link
Contributor

@Jordan-Mysten Jordan-Mysten commented Mar 24, 2023

Description

On object and address pages, the transaction table used a deprecated method and required calling multiGetTransactions to populate. This caused it to fail for big objects / transactions. Rewriting onto native queryTransactions. For now, this has the limitation of not being able to paginate, because we need to interleave two result sets. But once the API is updated to support this filter we can pretty easily change that.

Test Plan

Ran locally.

@vercel
Copy link

vercel bot commented Mar 24, 2023

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

Name Status Preview Comments Updated
explorer ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 27, 2023 at 4:45PM (UTC)
explorer-storybook ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 27, 2023 at 4:45PM (UTC)
wallet-adapter ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 27, 2023 at 4:45PM (UTC)

Copy link
Contributor Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@vercel vercel bot temporarily deployed to Preview – explorer-storybook March 24, 2023 19:44 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-adapter March 24, 2023 19:46 Inactive
Copy link
Contributor

@williamrobertson13 williamrobertson13 left a comment

Choose a reason for hiding this comment

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

lgtm!

const tableData = genTableDataFromTxData(data);

return (
<div data-testid="tx">
Copy link
Contributor

Choose a reason for hiding this comment

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

is this data-testid needed for an E2E test? if so, a more descriptive name would be nice 😄

)
);

return [...results[0].data, ...results[1].data].sort(
Copy link
Contributor

Choose a reason for hiding this comment

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

this might be a pre-mature optimization, but I recently learned about the select option in react-query for doing data transformations which could be nice to use here

https://tkdodo.eu/blog/react-query-data-transformations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense when we want to have a view over the data that we're fetching, but in this case this is defining the actual return data (basically simulating a single list). Eventually this will move to a single queryTransaction which will also solve this problem.

@Jordan-Mysten Jordan-Mysten force-pushed the jordan--Rebuild_transactions_for_address_/_object branch from 4d662d5 to d82a8a4 Compare March 27, 2023 16:42
@vercel vercel bot temporarily deployed to Preview – wallet-adapter March 27, 2023 16:45 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook March 27, 2023 16:45 Inactive
@Jordan-Mysten Jordan-Mysten merged commit b1c8042 into main Mar 27, 2023
@Jordan-Mysten Jordan-Mysten deleted the jordan--Rebuild_transactions_for_address_/_object branch March 27, 2023 16:58
666lcz pushed a commit that referenced this pull request Mar 28, 2023
## Description 

On object and address pages, the transaction table used a deprecated
method and required calling multiGetTransactions to populate. This
caused it to fail for big objects / transactions. Rewriting onto native
queryTransactions. For now, this has the limitation of not being able to
paginate, because we need to interleave two result sets. But once the
API is updated to support this filter we can pretty easily change that.

## Test Plan 

Ran locally.
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.

3 participants