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

Rust client improvements #155

Merged
merged 4 commits into from
Jul 1, 2024

Conversation

danenbm
Copy link
Contributor

@danenbm danenbm commented Jun 28, 2024

Notes

  • Added fetch_external_plugin_adapter_data()
  • Added Anchor trait implementations that enable deserializing in Anchor via Account<BaseAssetV1> and Account<BaseCollectionV1>.
  • Box the return types for Rust client Asset and Collection deserialization functions, and move the required plugin deserializion into helper functions to reduce stack frame. Together these changes mitigate stack overflow when using Asset and Collection types.
  • Added back in fetch_wrapped_external_plugin_adapter() as I used it for fetch_external_plugin_adapter_data(), but made it based on a helper to avoid double-deserialization in fetch_external_plugin_adapter().

Testing

  • Added fetch_external_plugin_adapter_data() to test_create_and_fetch_app_data.
  • Validated Account<BaseAssetV1> and Account<BaseCollectionV1> works in an Anchor program.
  • Validated Asset::from_bytes() and Collection::from_bytes() could be used in an Anchor program where a large Attributes plugin was previously causing stack overflow.

Copy link

vercel bot commented Jun 28, 2024

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

Name Status Preview Comments Updated (UTC)
mpl-core-js-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 7:24am

Copy link
Contributor

@blockiosaurus blockiosaurus left a comment

Choose a reason for hiding this comment

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

This is so good! Thank you!

@danenbm danenbm merged commit 5fea404 into jun-2024-feature-staging Jul 1, 2024
10 checks passed
@danenbm danenbm deleted the danenbm/rust-client-improvements branch July 1, 2024 18:26
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.

None yet

3 participants