1#[derive(Debug, Clone, Eq, PartialEq, thiserror::Error)]
5pub enum Error {
6 #[error("cell underflow")]
8 CellUnderflow,
9 #[error("cell overflow")]
11 CellOverflow,
12 #[error("pruned branch access")]
14 PrunedBranchAccess,
15 #[error("invalid cell")]
17 InvalidCell,
18 #[error("invalid data")]
20 InvalidData,
21 #[error("invalid tag")]
23 InvalidTag,
24 #[error("empty proof")]
26 EmptyProof,
27 #[error("cell depth overflow")]
29 DepthOverflow,
30 #[error("invalid signature")]
32 InvalidSignature,
33 #[error("invalid public key")]
35 InvalidPublicKey,
36 #[error("underlying integer is too large to fit in target type")]
38 IntOverflow,
39 #[error("operation cancelled")]
41 Cancelled,
42 #[error("unbalanced structure")]
44 Unbalanced,
45}
46
47#[derive(Debug, Clone, thiserror::Error)]
49pub enum ParseIntError {
50 #[error("cannot parse underlying integer")]
52 InvalidString(#[source] std::num::ParseIntError),
53 #[error("underlying integer is too large to fit in target type")]
55 Overflow,
56}
57
58#[derive(Debug, Clone, thiserror::Error)]
60pub enum ParseHashBytesError {
61 #[cfg(feature = "base64")]
63 #[error("invalid base64 string")]
64 InvalidBase64(#[from] base64::DecodeSliceError),
65 #[error("invalid hex string")]
67 InvalidHex(#[from] hex::FromHexError),
68 #[error("expected string of 44, 64 or 66 bytes")]
70 UnexpectedStringLength,
71}
72
73#[derive(Debug, Clone, thiserror::Error)]
75pub enum ParseAddrError {
76 #[error("cannot parse address from an empty string")]
78 Empty,
79 #[error("workchain id is too large to fit in target type")]
81 InvalidWorkchain,
82 #[error("cannot parse account id")]
84 InvalidAccountId,
85 #[error("unexpected address part")]
87 UnexpectedPart,
88 #[error("invalid address format")]
90 BadFormat,
91}
92
93#[derive(Debug, Clone, thiserror::Error)]
95pub enum ParseBlockIdError {
96 #[error("cannot parse block id from an empty string")]
98 Empty,
99 #[error("cannot parse workchain id")]
101 InvalidWorkchain,
102 #[error("invalid shard id")]
104 InvalidShardIdent,
105 #[error("cannot parse block seqno")]
107 InvalidSeqno,
108 #[error("cannot parse root hash")]
110 InvalidRootHash,
111 #[error("cannot parse file hash")]
113 InvalidFileHash,
114 #[error("unexpected block id part")]
116 UnexpectedPart,
117}
118
119#[derive(Debug, Clone, thiserror::Error)]
121pub enum ParseGlobalCapabilityError {
122 #[error("unknown capability")]
124 UnknownCapability,
125}