Skip to content

Commit b29d16e

Browse files
authored
feat: add update guardian set ttl (#3418)
* go * fmt
1 parent ba8c813 commit b29d16e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

target_chains/solana/cli/src/cli.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ pub enum Action {
6767
about = "Initialize a wormhole receiver contract by sequentially replaying the guardian set updates"
6868
)]
6969
InitializeWormholeReceiver {},
70+
#[clap(about = "Update the guardian set TTL to 24h")]
71+
UpdateGuardianSetTtl {},
7072
InitializePythReceiver {
7173
#[clap(short = 'f', long, help = "Fee in lamports")]
7274
fee: u64,

target_chains/solana/cli/src/main.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use {
1616
solana_sdk::{
1717
commitment_config::CommitmentConfig,
1818
compute_budget::ComputeBudgetInstruction,
19-
instruction::Instruction,
19+
instruction::{AccountMeta, Instruction},
2020
pubkey::Pubkey,
2121
rent::Rent,
2222
signature::{read_keypair_file, Keypair},
@@ -195,6 +195,20 @@ fn main() -> Result<()> {
195195
}
196196
}
197197

198+
Action::UpdateGuardianSetTtl {} => {
199+
let rpc_client = RpcClient::new(url);
200+
let payer =
201+
read_keypair_file(&*shellexpand::tilde(&keypair)).expect("Keypair not found");
202+
let wormhole_config = BridgeConfig::key(&wormhole, ());
203+
204+
let instruction = Instruction {
205+
program_id: wormhole,
206+
accounts: vec![AccountMeta::new(wormhole_config, false)],
207+
data: vec![9], // UpdateGuardianSetTtl
208+
};
209+
process_transaction(&rpc_client, vec![instruction], &vec![&payer])?;
210+
}
211+
198212
Action::InitializePythReceiver {
199213
fee,
200214
emitter,

0 commit comments

Comments
 (0)