Skip to content

Commit

Permalink
Add constraint to initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
guibescos committed Feb 29, 2024
1 parent d8eecfa commit e84d9f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions target_chains/solana/programs/pyth-solana-receiver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ pub mod pyth_solana_receiver {
use super::*;

pub fn initialize(ctx: Context<Initialize>, initial_config: Config) -> Result<()> {
require!(
initial_config.minimum_signatures > 0,
ReceiverError::ZeroMinimumSignatures
);
let config = &mut ctx.accounts.config;
**config = initial_config;
Ok(())
Expand Down

0 comments on commit e84d9f9

Please sign in to comment.