#[derive(Debug, Clone, Eq, PartialEq, thiserror::Error)]
pub enum Error {
#[error("cell underflow")]
CellUnderflow,
#[error("cell overflow")]
CellOverflow,
#[error("pruned branch access")]
PrunedBranchAccess,
#[error("invalid cell")]
InvalidCell,
#[error("invalid data")]
InvalidData,
#[error("invalid tag")]
InvalidTag,
#[error("empty proof")]
EmptyProof,
#[error("cell depth overflow")]
DepthOverflow,
#[error("invalid signature")]
InvalidSignature,
#[error("invalid public key")]
InvalidPublicKey,
#[error("underlying integer is too large to fit in target type")]
IntOverflow,
#[error("operation cancelled")]
Cancelled,
#[error("unbalanced structure")]
Unbalanced,
}
#[derive(Debug, Clone, thiserror::Error)]
pub enum ParseIntError {
#[error("cannot parse underlying integer")]
InvalidString(#[source] std::num::ParseIntError),
#[error("underlying integer is too large to fit in target type")]
Overflow,
}
#[derive(Debug, Clone, thiserror::Error)]
pub enum ParseHashBytesError {
#[cfg(feature = "base64")]
#[error("invalid base64 string")]
InvalidBase64(#[from] base64::DecodeSliceError),
#[error("invalid hex string")]
InvalidHex(#[from] hex::FromHexError),
#[error("expected string of 44, 64 or 66 bytes")]
UnexpectedStringLength,
}
#[derive(Debug, Clone, thiserror::Error)]
pub enum ParseAddrError {
#[error("cannot parse address from an empty string")]
Empty,
#[error("workchain id is too large to fit in target type")]
InvalidWorkchain,
#[error("cannot parse account id")]
InvalidAccountId,
#[error("unexpected address part")]
UnexpectedPart,
#[error("invalid address format")]
BadFormat,
}
#[derive(Debug, Clone, thiserror::Error)]
pub enum ParseBlockIdError {
#[error("cannot parse block id from an empty string")]
Empty,
#[error("cannot parse workchain id")]
InvalidWorkchain,
#[error("invalid shard id")]
InvalidShardIdent,
#[error("cannot parse block seqno")]
InvalidSeqno,
#[error("cannot parse root hash")]
InvalidRootHash,
#[error("cannot parse file hash")]
InvalidFileHash,
#[error("unexpected block id part")]
UnexpectedPart,
}
#[derive(Debug, Clone, thiserror::Error)]
pub enum ParseGlobalCapabilityError {
#[error("unknown capability")]
UnknownCapability,
}