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

[Sui CLI] - Add dynamic field query support to Sui CLI #7151

Merged
merged 4 commits into from
Jan 10, 2023

Conversation

siomari
Copy link
Contributor

@siomari siomari commented Jan 5, 2023

This PR adds dynamic field query in Sui CLI

Example:
The example is from a capy that has some accessories which have dynamic fields.

Request:
sui client dynamic-field 0x6749be6620208f34d7fd175d886daf5b2d45eebd

Response:

                               Name                                 |      Type       |                           Object Type                           |                 Object Id                  |  Version   |                    Digest                   
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
0x2::object::ID {bytes: 0xfa8d439a16c3674b10701155c727807daed320c7} |  DynamicObject  | 0x30136e80e16ac92ff33a0ac2d67c64dc129eb0bc::capy_item::CapyItem | 0xfa8d439a16c3674b10701155c727807daed320c7 |   36467    | 92zrPyn5sFdY3Ke3ADcKpjAJFK+aHE+XCOd3jPIkIyk=
0x2::object::ID {bytes: 0x44ba7bc26af2f0b17ffbad866d11bb2b3aaf567e} |  DynamicObject  | 0x30136e80e16ac92ff33a0ac2d67c64dc129eb0bc::capy_item::CapyItem | 0x44ba7bc26af2f0b17ffbad866d11bb2b3aaf567e |   37402    | 7hO3WcYt0j2fbqNyFr5x6ozArYaIKwsG6hCwkfLi4bs=
Showing 2 results.

@vercel
Copy link

vercel bot commented Jan 5, 2023

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

Name Status Preview Comments Updated
explorer 🔄 Building (Inspect) Jan 10, 2023 at 0:45AM (UTC)
wallet-adapter ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 10, 2023 at 0:45AM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
explorer-storybook ⬜️ Ignored (Inspect) Jan 10, 2023 at 0:45AM (UTC)

@siomari siomari requested review from patrickkuo and 666lcz January 5, 2023 11:55
"Name", "Type", "Object Type", "Object Id", "Version", "Digest"
)?;
writeln!(writer, "{}", ["-"; 165].join(""))?;
loop{
Copy link
Contributor

Choose a reason for hiding this comment

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

this loop is printing the same data over and over again if next_cursor is not None, until out of memory.

The loop to fetch the data pages should happen in line 517 instead and pass a Dec to here.

@siomari siomari requested a review from patrickkuo January 9, 2023 14:27
Copy link
Contributor

@patrickkuo patrickkuo left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @siomari

@patrickkuo patrickkuo force-pushed the ms/add_dynamic_filed_query_to_sui_cli branch from 5599d11 to 777874d Compare January 10, 2023 12:44
@vercel vercel bot temporarily deployed to Preview – wallet-adapter January 10, 2023 12:45 Inactive
@siomari siomari merged commit 1299b2d into main Jan 10, 2023
@siomari siomari deleted the ms/add_dynamic_filed_query_to_sui_cli branch January 10, 2023 13:32
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