hopr_chain_indexer/
errors.rs

1use alloy::{dyn_abi::Error as AbiError, sol_types::Error as SolTypeError};
2use hopr_primitive_types::{errors::GeneralError, primitives::Address};
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum CoreEthereumIndexerError {
7    #[error("{0}")]
8    ProcessError(String),
9
10    #[error(transparent)]
11    DbApiError(#[from] hopr_db_sql::errors::DbSqlError),
12
13    #[error(transparent)]
14    DbError(#[from] hopr_db_sql::api::errors::DbError),
15
16    #[error(transparent)]
17    DbEntityError(#[from] hopr_db_entity::errors::DbEntityError),
18
19    #[error(transparent)]
20    AbiError(#[from] AbiError),
21
22    #[error(transparent)]
23    SolTypeError(#[from] SolTypeError),
24
25    #[error(transparent)]
26    GeneralError(#[from] GeneralError),
27
28    #[error("{0}")]
29    ValidationError(String),
30
31    #[error("Address announcement without a preceding key binding.")]
32    AnnounceBeforeKeyBinding,
33
34    #[error("Address announcement contains empty Multiaddr.")]
35    AnnounceEmptyMultiaddr,
36
37    #[error("Node has already announced a key binding. Reassigning keys is not supported.")]
38    UnsupportedKeyRebinding,
39
40    #[error("Address revocation before key binding.")]
41    RevocationBeforeKeyBinding,
42
43    #[error("Could not verify account entry signature. Maybe a cross-signing issue?")]
44    AccountEntrySignatureVerification,
45
46    #[error("Received an event for a channel that is closed or for which we haven't seen an OPEN event.")]
47    ChannelDoesNotExist,
48
49    #[error("Cannot deregister non-existent MFA module")]
50    MFAModuleDoesNotExist,
51
52    #[error("Unknown smart contract. Received event from {0}")]
53    UnknownContract(Address),
54
55    #[error(transparent)]
56    MultiaddrParseError(#[from] multiaddr::Error),
57
58    #[error(transparent)]
59    RpcError(#[from] hopr_chain_rpc::errors::RpcError),
60}
61
62pub type Result<T> = core::result::Result<T, CoreEthereumIndexerError>;