Skip to content

Conversation

@guibescos
Copy link
Contributor

@guibescos guibescos commented Aug 5, 2022

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.

@guibescos guibescos changed the title Base test, clippy stopped working Add mapping tests Aug 5, 2022
@guibescos guibescos marked this pull request as ready for review August 5, 2022 21:11
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 {
Copy link
Contributor Author

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.

Copy link
Contributor Author

@guibescos guibescos Aug 5, 2022

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

Copy link
Contributor

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.

Copy link
Contributor

@jayantk jayantk left a 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.

@guibescos guibescos merged commit f5e997b into main Aug 8, 2022
@guibescos guibescos deleted the test-add-mapping branch August 8, 2022 15:47
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