Skip to content

Conversation

jayantk
Copy link
Contributor

@jayantk jayantk commented Aug 10, 2022

No description provided.

unsafe impl Pod for pc_ema {
}

#[cfg(target_endian = "little")]
Copy link
Contributor Author

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)?;

Copy link
Contributor

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)

Copy link
Contributor

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;
Copy link
Contributor

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

Copy link
Contributor

@guibescos guibescos left a 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 );
}
Copy link
Contributor Author

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

@guibescos guibescos merged commit 90e7769 into main Aug 11, 2022
@guibescos guibescos deleted the init_price branch August 11, 2022 18:58
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.

2 participants