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

solana: type annotations needed #94

Merged
merged 3 commits into from
Apr 18, 2024
Merged

solana: type annotations needed #94

merged 3 commits into from
Apr 18, 2024

Conversation

a5-pickle
Copy link
Contributor

No description provided.

@a5-pickle a5-pickle requested a review from gator-boi April 17, 2024 19:03
gator-boi
gator-boi previously approved these changes Apr 17, 2024
Copy link

@johnsaigle johnsaigle left a comment

Choose a reason for hiding this comment

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

Overall looks good.

I'm wondering if the saturating_adds here might be better as checked_add? I'm unclear on the expected behaviour if the written_size exceeds usize here, but it seems like under-reporting the number of bytes might be worse than just panicking especially because we essentially never ever expect this to happen for Wormhole.

What do you think?

@a5-pickle
Copy link
Contributor Author

Overall looks good.

I'm wondering if the saturating_adds here might be better as checked_add? I'm unclear on the expected behaviour if the written_size exceeds usize here, but it seems like under-reporting the number of bytes might be worse than just panicking especially because we essentially never ever expect this to happen for Wormhole.

What do you think?

I agree. Added it here: 7cf200c.

Fun fact... I'm looking into removing this written size method from the trait. This sort of requirement is better suited for the TypePrefixedPayload trait. So we can remove this once I get around to updating the wormhole_io crate.

@gator-boi gator-boi merged commit 3c43a88 into main Apr 18, 2024
3 checks passed
@gator-boi gator-boi deleted the solana/type-annotations branch April 18, 2024 01:14
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