diff --git a/packages/layerzero-v2/solana/programs/programs/dvn/src/instructions/admin/set_config.rs b/packages/layerzero-v2/solana/programs/programs/dvn/src/instructions/admin/set_config.rs index 4c2153c..f692e59 100644 --- a/packages/layerzero-v2/solana/programs/programs/dvn/src/instructions/admin/set_config.rs +++ b/packages/layerzero-v2/solana/programs/programs/dvn/src/instructions/admin/set_config.rs @@ -32,6 +32,7 @@ pub enum AdminConfig { DefaultMultiplierBps(u16), DstConfigs(Vec), PriceFeed(Pubkey), + RemoveDstConfigs(Vec), } impl AdminConfig { @@ -49,6 +50,9 @@ impl AdminConfig { AdminConfig::PriceFeed(price_feed) => { config.price_feed = *price_feed; }, + AdminConfig::RemoveDstConfigs(dst_eids) => { + config.remove_dst_configs(dst_eids.clone())?; + }, } Ok(()) } diff --git a/packages/layerzero-v2/solana/programs/programs/dvn/src/state/dvn_config.rs b/packages/layerzero-v2/solana/programs/programs/dvn/src/state/dvn_config.rs index 89bd06e..81e4f34 100644 --- a/packages/layerzero-v2/solana/programs/programs/dvn/src/state/dvn_config.rs +++ b/packages/layerzero-v2/solana/programs/programs/dvn/src/state/dvn_config.rs @@ -74,6 +74,13 @@ impl DvnConfig { } Ok(()) } + + pub fn remove_dst_configs(&mut self, dst_eids: Vec) -> Result<()> { + for eid in dst_eids { + sorted_list_helper::remove_from_sorted_list_by_eid(&mut self.dst_configs, eid)?; + } + Ok(()) + } } impl sorted_list_helper::EID for DstConfig {