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

refactor(pythnet/pythnet_sdk): add test for update data with fixture #2551

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

ali-bahjati
Copy link
Collaborator

Summary

add test for update data with fixture

Rationale

This is a good test but also a good tool to deserialize update data for troubleshooting. If we get many requests to parse the update data we can add it as an API to Hermes or make a CLI for it but I don't think it's necessary for now.

How has this been tested?

  • Added new tests

this is a good test but also a good tool to deserialize update data for
troubleshooting.
Copy link

vercel bot commented Apr 3, 2025

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

6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Visit Preview Apr 3, 2025 5:03pm
component-library ⬜️ Ignored (Inspect) Apr 3, 2025 5:03pm
entropy-debugger ⬜️ Ignored (Inspect) Visit Preview Apr 3, 2025 5:03pm
insights ⬜️ Ignored (Inspect) Visit Preview Apr 3, 2025 5:03pm
proposals ⬜️ Ignored (Inspect) Visit Preview Apr 3, 2025 5:03pm
staking ⬜️ Ignored (Inspect) Visit Preview Apr 3, 2025 5:03pm

let update = hex::decode(update).unwrap();
let update = AccumulatorUpdateData::try_from_slice(&update).unwrap();
let Proof::WormholeMerkle { vaa: _, updates } = update.proof;
println!("Updates: {:?}", updates.len());
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you want to keep these prints in? Should they be assertions instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The assertion is mostly the unwrap part. I kept the prints for debugging the contents.

@ali-bahjati ali-bahjati merged commit 9bb7a5a into main Apr 4, 2025
9 checks passed
@ali-bahjati ali-bahjati deleted the pythnet-sdk/wire-add-new-test branch April 4, 2025 09:01
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