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
#[cfg(feature = "ledger")]
use ledger_utility::error::LedgerUtilityError;
use thiserror::Error;
pub type DeployResult<T> = core::result::Result<T, DeployError>;
#[derive(Error, Debug)]
pub enum DeployError {
#[error("{0}")]
Generic(String),
#[error("Unsupported shell, must use bash or zsh")]
UnsupportedShell,
#[error("Chain already exists")]
ChainAlreadyExists,
#[error("Contract already exists")]
ContractAlreadyExists,
#[error("Contract not found")]
ContractNotFound,
#[error("Env already exists")]
EnvAlreadyExists,
#[error("Invalid directory")]
InvalidDir,
#[error("Contract does not have an address")]
NoAddr,
#[error("Key already exists")]
KeyAlreadyExists,
#[error("Key not found")]
KeyNotFound { key_name: String },
#[error("Code id not found")]
CodeIdNotFound,
#[error("Env not found")]
EnvNotFound,
#[error("Contract address not found for {name}, perhaps you need to instantiate first?")]
AddrNotFound { name: String },
#[error(
"{} Config file not found, perhaps you need to run \"deploy init\"?",
"Deploy Error"
)]
ConfigNotFound {},
#[error(
"Both gRPC endpoint and RPC endpoint cannot be null.\
Update you ChainInfo to add at least one endpoint"
)]
MissingClient,
#[error(
"The current version of wasm-deploy requires the gRPC endpoint.\
Update you ChainInfo to include the endpoint address"
)]
MissingGRpc,
#[error(
"The current version of wasm-deploy requires the RPC endpoint.\
Update you ChainInfo to include the endpoint address"
)]
MissingRpc,
#[error(
"This feature has not been implemented for this contract.\
Implement the relevant trait and try again."
)]
TraitNotImplemented,
}
#[cfg(test)]
mod test {
use super::DeployError;
fn test_send_sync<T: Send + Sync>(_: T) {}
#[test]
fn test_deploy_error() {
test_send_sync(DeployError::Generic("".to_string()));
}
}