Skip to content

Commit

Permalink
go
Browse files Browse the repository at this point in the history
  • Loading branch information
guibescos committed Sep 13, 2024
1 parent 912255b commit 2620f2b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions staking/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,8 @@ pub enum Action {
#[clap(long, help = "Stake account positions")]
stake_account_positions: Pubkey,
},
UpdateY {
#[clap(long, help = "New Y")]
y: u64,
},
}
20 changes: 20 additions & 0 deletions staking/cli/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,3 +686,23 @@ pub fn slash(

process_transaction(rpc_client, &[instruction], &[signer]);
}

pub fn update_y(rpc_client: &RpcClient, signer: &Keypair, y: u64) {
let pool_config = get_pool_config_address();

let accounts = integrity_pool::accounts::UpdateY {
reward_program_authority: signer.pubkey(),
pool_config,
system_program: system_program::ID,
};

let instruction_data = integrity_pool::instruction::UpdateY { y };

let instruction = Instruction {
program_id: integrity_pool::ID,
accounts: accounts.to_account_metas(None),
data: instruction_data.data(),
};

process_transaction(rpc_client, &[instruction], &[signer]);
}
2 changes: 2 additions & 0 deletions staking/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use {
slash,
update_delegation_fee,
update_reward_program_authority,
update_y,
},
solana_client::rpc_client::RpcClient,
solana_sdk::commitment_config::CommitmentConfig,
Expand Down Expand Up @@ -75,5 +76,6 @@ fn main() {
publisher,
stake_account_positions,
} => slash(&rpc_client, &keypair, &publisher, &stake_account_positions),
Action::UpdateY { y } => update_y(&rpc_client, &keypair, y),
}
}

0 comments on commit 2620f2b

Please sign in to comment.