Skip to content

Commit

Permalink
feat: add update pyth token mint instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvankhademi committed Sep 3, 2024
1 parent fac01eb commit 72f3d27
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions staking/programs/integrity-pool/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ pub struct UpdateY<'info> {
pub system_program: Program<'info, System>,
}

#[derive(Accounts)]
pub struct UpdatePythTokenMint<'info> {
pub reward_program_authority: Signer<'info>,

#[account(
mut,
seeds = [POOL_CONFIG.as_bytes()],
bump,
has_one = reward_program_authority @ IntegrityPoolError::InvalidRewardProgramAuthority,
)]
pub pool_config: Account<'info, PoolConfig>,

pub system_program: Program<'info, System>,
}

#[derive(Accounts)]
pub struct UpdateDelegationFee<'info> {
pub reward_program_authority: Signer<'info>,
Expand Down
8 changes: 8 additions & 0 deletions staking/programs/integrity-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ pub mod integrity_pool {
Ok(())
}

pub fn update_pyth_token_mint(
ctx: Context<UpdatePythTokenMint>,
pyth_token_mint: Pubkey,
) -> Result<()> {
ctx.accounts.pool_config.pyth_token_mint = pyth_token_mint;
Ok(())
}

pub fn update_delegation_fee(
ctx: Context<UpdateDelegationFee>,
delegation_fee: frac64,
Expand Down

0 comments on commit 72f3d27

Please sign in to comment.