Skip to content

Commit

Permalink
fix(cli): log unexpected contract errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mempirate committed Dec 6, 2024
1 parent a8556a2 commit 2e4b4e4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
21 changes: 17 additions & 4 deletions bolt-cli/src/commands/operators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use alloy::{
primitives::{utils::format_ether, Bytes},
providers::{Provider, ProviderBuilder, WalletProvider},
signers::{local::PrivateKeySigner, SignerSync},
sol_types::SolInterface,
};
use eyre::Context;
use tracing::{info, warn};
Expand Down Expand Up @@ -175,7 +176,10 @@ impl OperatorsCommand {
BoltEigenLayerMiddlewareErrors::NotOperator(_) => {
eyre::bail!("Operator not registered in EigenLayer")
}
_ => unreachable!(),
other => unreachable!(
"Unexpected error with selector {:?}",
other.selector()
),
}
}
}
Expand Down Expand Up @@ -225,7 +229,10 @@ impl OperatorsCommand {
BoltEigenLayerMiddlewareErrors::NotRegistered(_) => {
eyre::bail!("Operator not registered in bolt")
}
_ => unreachable!(),
other => unreachable!(
"Unexpected error with selector {:?}",
other.selector()
),
}
}
}
Expand Down Expand Up @@ -314,7 +321,10 @@ impl OperatorsCommand {
BoltSymbioticMiddlewareErrors::NotOperator(_) => {
eyre::bail!("Operator not registered in Symbiotic")
}
_ => unreachable!(),
other => unreachable!(
"Unexpected error with selector {:?}",
other.selector()
),
}
}
}
Expand Down Expand Up @@ -365,7 +375,10 @@ impl OperatorsCommand {
BoltSymbioticMiddlewareErrors::NotRegistered(_) => {
eyre::bail!("Operator not registered in bolt")
}
_ => unreachable!(),
other => unreachable!(
"Unexpected error with selector {:?}",
other.selector()
),
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion bolt-cli/src/commands/validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use alloy::{
network::EthereumWallet,
providers::{Provider, ProviderBuilder},
signers::local::PrivateKeySigner,
sol_types::SolInterface,
};
use ethereum_consensus::crypto::PublicKey as BlsPublicKey;
use eyre::Context;
Expand Down Expand Up @@ -91,7 +92,10 @@ impl ValidatorsCommand {
BoltValidatorsErrors::InvalidAuthorizedOperator(_) => {
eyre::bail!("Invalid authorized operator")
}
_ => eyre::bail!("Unknown contract error"),
other => unreachable!(
"Unexpected error with selector {:?}",
other.selector()
),
}
}
}
Expand Down

0 comments on commit 2e4b4e4

Please sign in to comment.