mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-26 20:01:16 +00:00
feat(wallet): sequencers removal added as well
This commit is contained in:
@@ -29,6 +29,8 @@ pub enum ConfigSubcommand {
|
||||
user: Option<String>,
|
||||
password: Option<String>,
|
||||
},
|
||||
/// Remove sequencer from a list.
|
||||
RemoveSequencer { addr: String },
|
||||
}
|
||||
|
||||
impl ConfigSubcommand {
|
||||
@@ -202,6 +204,21 @@ impl WalletSubcommand for ConfigSubcommand {
|
||||
|
||||
wallet_core.config.sequencers.push(seq_connection_data);
|
||||
|
||||
Ok(SubcommandReturnValue::Empty)
|
||||
}
|
||||
Self::RemoveSequencer { addr } => {
|
||||
let url_addr = addr.parse()?;
|
||||
|
||||
let (idx, _) = wallet_core
|
||||
.config
|
||||
.sequencers
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find(|(_, conn_data)| conn_data.sequencer_addr == url_addr)
|
||||
.ok_or_else(|| anyhow::anyhow!("Sequencer with this addr is not found"))?;
|
||||
|
||||
wallet_core.config.sequencers.remove(idx);
|
||||
|
||||
Ok(SubcommandReturnValue::Empty)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user