ca7cbac320
* chore: make 'DirectSecp256k1HdWallet' only derive its keys once on construction Previously all the keys and account information was being derived for every transaction signed * no longer keep account seed on the wallet struct
45 lines
1.3 KiB
Rust
45 lines
1.3 KiB
Rust
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use crate::nym_api;
|
|
use crate::signing::direct_wallet::DirectSecp256k1HdWalletError;
|
|
pub use tendermint_rpc::error::Error as TendermintRpcError;
|
|
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum ValidatorClientError {
|
|
#[error("nym api request failed: {source}")]
|
|
NymAPIError {
|
|
source: Box<nym_api::error::NymAPIError>,
|
|
},
|
|
|
|
#[error("Tendermint RPC request failure: {0}")]
|
|
TendermintErrorRpc(#[from] TendermintRpcError),
|
|
|
|
#[error("One of the provided URLs was malformed - {0}")]
|
|
MalformedUrlProvided(#[from] url::ParseError),
|
|
|
|
#[error("nyxd request failed: {0}")]
|
|
NyxdError(#[from] crate::nyxd::error::NyxdError),
|
|
|
|
#[error("the response metadata has changed between pages")]
|
|
InconsistentPagedMetadata,
|
|
|
|
#[error("No validator API url has been provided")]
|
|
NoAPIUrlAvailable,
|
|
|
|
#[error("failed to derive signing accounts: {source}")]
|
|
AccountDerivationFailure {
|
|
#[from]
|
|
source: DirectSecp256k1HdWalletError,
|
|
},
|
|
}
|
|
|
|
impl From<nym_api::error::NymAPIError> for ValidatorClientError {
|
|
fn from(source: nym_api::error::NymAPIError) -> Self {
|
|
ValidatorClientError::NymAPIError {
|
|
source: Box::new(source),
|
|
}
|
|
}
|
|
}
|