From 5f2845c39b530faac050e8b40c957e93e0921797 Mon Sep 17 00:00:00 2001 From: evgeniko <97796468+evgeniko@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:12:19 +0100 Subject: [PATCH] solana: make peers upgradable (#559) * make peers upgradable * remove todo comment over set peer --- .../src/instructions/admin.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/solana/programs/example-native-token-transfers/src/instructions/admin.rs b/solana/programs/example-native-token-transfers/src/instructions/admin.rs index 76e49eaef..3486e21a4 100644 --- a/solana/programs/example-native-token-transfers/src/instructions/admin.rs +++ b/solana/programs/example-native-token-transfers/src/instructions/admin.rs @@ -155,8 +155,6 @@ pub fn claim_ownership(ctx: Context) -> Result<()> { } // * Set peers -// TODO: update peers? should that be a separate instruction? take timestamp -// for modification? (for total ordering) #[derive(Accounts)] #[instruction(args: SetPeerArgs)] @@ -172,7 +170,7 @@ pub struct SetPeer<'info> { pub config: Account<'info, Config>, #[account( - init, + init_if_needed, space = 8 + NttManagerPeer::INIT_SPACE, payer = payer, seeds = [NttManagerPeer::SEED_PREFIX, args.chain_id.id.to_be_bytes().as_ref()], @@ -181,7 +179,7 @@ pub struct SetPeer<'info> { pub peer: Account<'info, NttManagerPeer>, #[account( - init, + init_if_needed, space = 8 + InboxRateLimit::INIT_SPACE, payer = payer, seeds = [