Skip to content

Commit

Permalink
Merge pull request #1143 from drift-labs/nour/validate-fix
Browse files Browse the repository at this point in the history
validate fix
  • Loading branch information
NourAlharithi authored Jul 16, 2024
2 parents f431c00 + 2936a99 commit 870f57b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions programs/drift/src/instructions/pyth_pull_oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn handle_update_pyth_pull_oracle(
validate!(
price_feed_account.price_message.feed_id == feed_id,
ErrorCode::OraclePriceFeedMessageMismatch
);
)?;
}
}
Ok(())
Expand Down Expand Up @@ -100,7 +100,7 @@ pub fn handle_post_pyth_pull_oracle_update_atomic(
validate!(
price_feed_account.price_message.feed_id == feed_id,
ErrorCode::OraclePriceFeedMessageMismatch
);
)?;
}
}
Ok(())
Expand All @@ -114,15 +114,15 @@ pub fn handle_post_multi_pyth_pull_oracle_updates_atomic<'c: 'info, 'info>(
validate!(
remaining_accounts.len() <= 2,
ErrorCode::OracleTooManyPriceAccountUpdates
);
)?;
let update_param = PostMultiUpdatesAtomicParams::deserialize(&mut &params[..]).unwrap();
let vaa = update_param.vaa;
let merkle_price_updates = update_param.merkle_price_updates;

validate!(
remaining_accounts.len() == merkle_price_updates.len(),
ErrorCode::OracleMismatchedVaaAndPriceUpdates
);
)?;

for (account, merkle_price_update) in remaining_accounts.iter().zip(merkle_price_updates.iter())
{
Expand Down

0 comments on commit 870f57b

Please sign in to comment.