Skip to content

Commit

Permalink
add pyth verify direct
Browse files Browse the repository at this point in the history
  • Loading branch information
NourAlharithi committed Dec 18, 2024
1 parent 1f8d9d4 commit 57ed54b
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,28 @@ pub mod pyth_lazer_solana_contract {
}
}

pub fn verify_message_direct<'a>(
pyth_storage_account: &Storage,
instruction_sysvar: &AccountInfo,
message_data: &'a [u8],
ed25519_instruction_index: u16,
signature_index: u8,
message_offset: u16,
) -> Result<VerifiedMessage> {
signature::verify_message(
pyth_storage_account,
instruction_sysvar,
&message_data,
ed25519_instruction_index,
signature_index,
message_offset,
)
.map_err(|err| {
msg!("signature verification error: {:?}", err);
err.into()
})
}

#[derive(Accounts)]
pub struct Initialize<'info> {
#[account(mut)]
Expand Down

0 comments on commit 57ed54b

Please sign in to comment.