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
use bee_message::{payload::milestone::MilestoneId, Error as MessageError};
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Message error: {0}")]
Message(#[from] MessageError),
#[error("Unsupported output kind: {0}")]
UnsupportedOutputKind(u8),
#[error("Unsupported input kind: {0}")]
UnsupportedInputKind(u8),
#[error("Unsupported payload kind: {0}")]
UnsupportedPayloadKind(u32),
#[error("Invalid payload kind: {0}")]
InvalidPayloadKind(u32),
#[error("Treasury amount mismatch: {0} != {1}")]
TreasuryAmountMismatch(u64, u64),
#[error("Migrated funds amount overflow: {0}")]
MigratedFundsAmountOverflow(u128),
#[error("Invalid migrated funds amount: {0}")]
InvalidMigratedFundsAmount(u64),
#[error("Consumed treasury output mismatch: {0} != {1}")]
ConsumedTreasuryOutputMismatch(MilestoneId, MilestoneId),
#[error("Negative balance: {0}")]
NegativeBalance(i64),
#[error("Negative dust allowance: {0}")]
NegativeDustAllowance(i64),
#[error("Negative dust outputs: {0}")]
NegativeDustOutputs(i64),
#[error("Balance overflow: {0}")]
BalanceOverflow(i128),
#[error("Invalid balance: {0}")]
InvalidBalance(u64),
#[error("Balance diff overflow: {0}")]
BalanceDiffOverflow(i128),
#[error("Invalid balance diff: {0}")]
InvalidBalanceDiff(i64),
#[error("Packable option error happened")]
PackableOption,
#[error("Invalid snapshot kind: {0}")]
InvalidSnapshotKind(u8),
#[error("Unsupported snapshot version: supports {0}, read {1}")]
UnsupportedVersion(u8, u8),
#[error("Missing consumed treasury")]
MissingConsumedTreasury,
#[error("Milestone length mismatch: expected {0}, got {1}")]
MilestoneLengthMismatch(usize, usize),
}