-
Notifications
You must be signed in to change notification settings - Fork 116
Implement init_price instruction #242
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
Conversation
unsafe impl Pod for pc_ema { | ||
} | ||
|
||
#[cfg(target_endian = "little")] |
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.
this was missing before for some reason
instruction_data: &[u8], | ||
) -> OracleResult { | ||
let cmd_args = load::<cmd_init_price_t>(instruction_data)?; | ||
|
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 check that instruction_data.len() == size_of::<cmd_init_price_t>(cmd_init_price)
went away because load
will work as long as instruction_data.len() >= size_of::<cmd_init_price_t>(cmd_init_price)
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.
Just flagging the differences with C, I think this is acceptable.
Err(ProgramError::InvalidArgument) | ||
); | ||
|
||
price_account.is_signer = false; |
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 think you meant to make this true
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 important stuff about this function are the things that don't get set to 0.
I think it'd be great to test setting some publisher pubkeys to non-zero value and check that they didn't get set to 0.
SolPubkey_same( ka->owner, prm->program_id ) && | ||
ka->data_len >= min_dlen && | ||
is_rent_exempt( *ka->lamports, ka->data_len ); | ||
} |
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.
no longer used, and the c build fails if you have unused functions
No description provided.