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
use thiserror::Error;
use uint::FromDecStrErr;
use casper_types::account::ACCOUNT_HASH_LENGTH;
use crate::utils::{LoadError, ReadFileError};
#[derive(Debug, Error)]
pub enum Error {
#[error("encoding error: {0}")]
EncodingToToml(#[from] toml::ser::Error),
#[error("decoding from TOML error: {0}")]
DecodingFromToml(#[from] toml::de::Error),
#[error("decoding motes from base-10 error: {0}")]
DecodingMotes(#[from] FromDecStrErr),
#[error(
"could not load upgrade installer: {0} - if the file is missing, try running \
'make build-system-contracts' from the workspace root"
)]
LoadUpgradeInstaller(LoadError<ReadFileError>),
#[error("could not load chainspec: {0}")]
LoadChainspec(ReadFileError),
#[error(
"could not load mint installer: {0} - if the file is missing, try running \
'make build-system-contracts' from the workspace root"
)]
LoadMintInstaller(LoadError<ReadFileError>),
#[error(
"could not load pos installer: {0} - if the file is missing, try running \
'make build-system-contracts' from the workspace root"
)]
LoadPosInstaller(LoadError<ReadFileError>),
#[error(
"could not load standard payment installer: {0} - if the file is missing, try running \
'make build-system-contracts' from the workspace root"
)]
LoadStandardPaymentInstaller(LoadError<ReadFileError>),
#[error(
"could not load auction installer: {0} - if the file is missing, try running \
'make build-system-contracts' from the workspace root"
)]
LoadAuctionInstaller(LoadError<ReadFileError>),
#[error("could not load genesis accounts: {0}")]
LoadGenesisAccounts(LoadError<GenesisLoadError>),
}
#[derive(Debug, Error)]
pub enum GenesisLoadError {
#[error("decoding from CSV error: {0}")]
DecodingFromCsv(#[from] csv::Error),
#[error("decoding from hex error: {0}")]
DecodingFromHex(#[from] hex::FromHexError),
#[error("decoding motes from base-10 error: {0}")]
DecodingMotes(#[from] FromDecStrErr),
#[error("expected hash length of {}, got {0}", ACCOUNT_HASH_LENGTH)]
InvalidHashLength(usize),
#[error("crypto module error: {0}")]
Crypto(#[from] crate::crypto::Error),
}