Skip to content

Commit

Permalink
chore: sync dvn code
Browse files Browse the repository at this point in the history
  • Loading branch information
ziming-zung authored and zouguangxian committed Oct 18, 2024
1 parent 05b9fa8 commit cd66df2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub enum AdminConfig {
DefaultMultiplierBps(u16),
DstConfigs(Vec<DstConfig>),
PriceFeed(Pubkey),
RemoveDstConfigs(Vec<u32>),
}

impl AdminConfig {
Expand All @@ -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(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ impl DvnConfig {
}
Ok(())
}

pub fn remove_dst_configs(&mut self, dst_eids: Vec<u32>) -> 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 {
Expand Down

0 comments on commit cd66df2

Please sign in to comment.