1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use cosmrs::ErrorReport;
use hex::FromHexError;
use prost::{DecodeError, EncodeError};
use std::convert::Infallible;
use std::io;
use std::str::Utf8Error;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum CosmosClientError {
    #[error("Tendermint RPC Error")]
    TendermintRpcError(#[from] tendermint_rpc::Error),
    #[error("Decode Error")]
    ProstDecodeError(#[from] DecodeError),
    #[error("Decode Error")]
    ProstEncodeError(#[from] EncodeError),
    #[error("Json Error")]
    JsonError(#[from] serde_json::Error),
    #[error("CosmosRs tendermint Error")]
    CosmRsTendermintError(#[from] cosmrs::tendermint::Error),
    #[error("bip32 Error")]
    Bip32Error(#[from] cosmrs::bip32::Error),
    #[error("Timestamp Error")]
    TimestampError(#[from] prost_types::TimestampError),
    #[error("Utf8 Error")]
    Utf8Error(#[from] Utf8Error),
    #[error("Utf8 Error")]
    IoError(#[from] io::Error),
    #[error("ErrorReport")]
    ErrorReport(#[from] ErrorReport),
    #[error("FromHexError")]
    FromHexError(#[from] FromHexError),
    #[error("Infaillible")]
    Infaillible(#[from] Infallible),

    #[error("Unknown cosmos-sdk Msg")]
    UnknownCosmosMsg,
    #[error("Account does not exist {address:?}")]
    AccountDoesNotExistOnChain { address: String },
    #[error("Cannot simulate TX Gas Fee")]
    CannotSimulateTxGasFee,
    #[error("No signer attached")]
    NoSignerAttached,
}