Skip to content

Conversation

@guibescos
Copy link
Contributor

@guibescos guibescos commented Aug 24, 2022

This PR :

  • Creates rust structs in c_oracle_header.rs and replaces all the bindgen structs by the new structs.


#[repr(C)]
#[derive(Copy, Clone)]
pub union CPubkey {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both fields are currently used in the code. I feel like we can get to a safe derivation if we :

  • Replace CPubkey by the solana sdk Pubkey
  • Update functions to only use k1_ or k8_.
    Let's do it in a future PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with the first suggestion, we should use the solana Pubkey type directly in a future PR. The second suggestion would just keep us using the ad-hoc unsafe functions we should scrap.

@guibescos guibescos changed the title Get header Create rust structs and replace bindgen structs Aug 24, 2022
@guibescos guibescos marked this pull request as ready for review August 24, 2022 16:16
@Reisen Reisen self-requested a review August 25, 2022 11:41
@guibescos guibescos merged commit 8f0b980 into main Aug 25, 2022
@guibescos guibescos deleted the rust-structs-3 branch August 25, 2022 15:07
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