CLI Nonce account access dereplicode (#8743)
* Spruce up CliNonceError * Add nonce account access helpers * Use helpers throughout
This commit is contained in:
@ -409,7 +409,7 @@ pub struct CliCommandInfo {
|
||||
pub signers: CliSigners,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum CliError {
|
||||
BadParameter(String),
|
||||
CommandNotRecognized(String),
|
||||
@ -443,6 +443,17 @@ impl From<Box<dyn error::Error>> for CliError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CliNonceError> for CliError {
|
||||
fn from(error: CliNonceError) -> Self {
|
||||
match error {
|
||||
CliNonceError::Client(client_error) => {
|
||||
Self::RpcRequestError(format!("{:?}", client_error))
|
||||
}
|
||||
_ => Self::InvalidNonce(error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum SettingType {
|
||||
Explicit,
|
||||
Computed,
|
||||
|
Reference in New Issue
Block a user