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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
use webb::{
evm::ethers,
substrate::{dkg_runtime, protocol_substrate_runtime, subxt},
};
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Json(#[from] serde_json::Error),
#[error(transparent)]
Config(#[from] config::ConfigError),
#[error(transparent)]
GlobPattern(#[from] glob::PatternError),
#[error(transparent)]
Glob(#[from] glob::GlobError),
#[error(transparent)]
Url(#[from] url::ParseError),
#[error(transparent)]
Warp(#[from] warp::Error),
#[error(transparent)]
EllipticCurve(#[from] ethers::core::k256::elliptic_curve::Error),
#[error(transparent)]
Secp256k1(#[from] libsecp256k1::Error),
#[error(transparent)]
SubxtBasicError(#[from] subxt::BasicError),
#[error(transparent)]
DKGError(
#[from]
subxt::GenericError<
subxt::RuntimeError<dkg_runtime::api::DispatchError>,
>,
),
#[error(transparent)]
ProtocolSubstrateError(
#[from]
subxt::GenericError<
subxt::RuntimeError<protocol_substrate_runtime::api::DispatchError>,
>,
),
#[error(transparent)]
Metadata(#[from] subxt::MetadataError),
#[error(transparent)]
EthersProvider(#[from] ethers::providers::ProviderError),
#[error(transparent)]
EthersContract(
#[from]
ethers::contract::ContractError<
ethers::providers::Provider<ethers::providers::Http>,
>,
),
#[error(transparent)]
ScaleCodec(#[from] webb::substrate::scale::Error),
#[error(transparent)]
Sled(#[from] sled::Error),
#[error(transparent)]
SledTransaction(
#[from] sled::transaction::TransactionError<std::io::Error>,
),
#[error("{}", _0)]
Generic(&'static str),
#[error("Bridge not found for: {:?}", typed_chain_id)]
BridgeNotFound {
typed_chain_id: webb_proposals::TypedChainId,
},
#[error("Config parse error: {}", _0)]
ParseConfig(#[from] serde_path_to_error::Error<config::ConfigError>),
#[error("Chain Not Found: {}", chain_id)]
ChainNotFound {
chain_id: String,
},
#[error("Node Not Found: {}", chain_id)]
NodeNotFound {
chain_id: String,
},
#[error("Missing required private-key or SURI in the config")]
MissingSecrets,
#[error("Failed to send response to the client")]
FailedToSendResponse,
#[error("Task Force Restarted from an error")]
ForceRestart,
#[error("Task Stopped Apnormally")]
TaskStoppedApnormally,
}
pub type Result<T> = std::result::Result<T, Error>;