Skip to content

Commit

Permalink
Oracle has to be mut because it's payer
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass committed Oct 21, 2024
1 parent e04e669 commit 06defb9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::error::ErrorCode;
use crate::state::*;
use anchor_lang::prelude::*;
use shared_utils::resize_to_fit;

use crate::{error::ErrorCode, state::*};

#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
pub struct SetCurrentRewardsArgsV0 {
pub oracle_index: u16,
Expand All @@ -21,6 +21,7 @@ pub struct SetCurrentRewardsV0<'info> {
)]
pub recipient: Box<Account<'info, RecipientV0>>,
#[account(
mut,
constraint = args.oracle_index < lazy_distributor.oracles.len() as u16 @ ErrorCode::InvalidOracleIndex,
constraint = oracle.key() == lazy_distributor.oracles[usize::from(args.oracle_index)].oracle
)]
Expand Down

0 comments on commit 06defb9

Please sign in to comment.