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