-
Notifications
You must be signed in to change notification settings - Fork 119
Add mapping tests #223
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
Add mapping tests #223
Conversation
| let next_mapping_data = load_mapping_account_mut(&next_mapping, PC_VERSION).unwrap(); | ||
| let mut cur_mapping_data = load_mapping_account_mut(&cur_mapping, PC_VERSION).unwrap(); | ||
|
|
||
| assert!(unsafe { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pubkey operations are really horrible right now. They got implemented in pyth-solana-sdk, so I feel like we'll be able to fix them once we move from bindgen to pyth-solana-sdk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed my mind, I'll implement pc_pub_key_is_zero and pc_pub_key_equal and we can replace the functions when we start using pyth-solana-sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I think you can merge this PR now and update the tests with those functions in a separate pr.
jayantk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great.
Something to think about going forward: can we implement some helpers for writing tests more concisely? The tests are rather verbose right now, and that makes it hard for us to test everything thoroughly.
add_mapping test ported to rust.
The pubkey operations are really horrible right now. They got implemented in pyth-solana-sdk, so I feel like we'll be able to fix them once we move from bindgen to pyth-solana-sdk.