kona_protocol/info/
errors.rs

1//! Contains error types specific to the L1 block info transaction.
2
3/// An error type for parsing L1 block info transactions.
4#[derive(Debug, thiserror::Error, PartialEq, Eq, Copy, Clone)]
5pub enum BlockInfoError {
6    /// Failed to parse the L1 blob base fee scalar.
7    #[error("Failed to parse the L1 blob base fee scalar")]
8    L1BlobBaseFeeScalar,
9    /// Failed to parse the base fee scalar.
10    #[error("Failed to parse the base fee scalar")]
11    BaseFeeScalar,
12    /// Failed to parse the EIP-1559 denominator.
13    #[error("Failed to parse the EIP-1559 denominator")]
14    Eip1559Denominator,
15    /// Failed to parse the EIP-1559 elasticity parameter.
16    #[error("Failed to parse the EIP-1559 elasticity parameter")]
17    Eip1559Elasticity,
18    /// Failed to parse the Operator Fee Scalar.
19    #[error("Failed to parse the Operator fee scalar parameter")]
20    OperatorFeeScalar,
21    /// Failed to parse the Operator Fee Constant.
22    #[error("Failed to parse the Operator fee constant parameter")]
23    OperatorFeeConstant,
24}
25
26/// An error decoding an L1 block info transaction.
27#[derive(Debug, Eq, PartialEq, Clone, thiserror::Error)]
28pub enum DecodeError {
29    /// Missing selector bytes.
30    #[error("The provided calldata is too short, missing the 4 selector bytes")]
31    MissingSelector,
32    /// Invalid selector for the L1 info transaction.
33    #[error("Invalid L1 info transaction selector")]
34    InvalidSelector,
35    /// Invalid length for the L1 info bedrock transaction.
36    /// Arguments are the expected length and the actual length.
37    #[error("Invalid bedrock data length. Expected {0}, got {1}")]
38    InvalidBedrockLength(usize, usize),
39    /// Invalid length for the L1 info ecotone transaction.
40    /// Arguments are the expected length and the actual length.
41    #[error("Invalid ecotone data length. Expected {0}, got {1}")]
42    InvalidEcotoneLength(usize, usize),
43    /// Invalid length for the L1 info isthmus transaction.
44    /// Arguments are the expected length and the actual length.
45    #[error("Invalid isthmus data length. Expected {0}, got {1}")]
46    InvalidIsthmusLength(usize, usize),
47    /// Invalid length for the L1 info interop transaction.
48    /// Arguments are the expected length and the actual length.
49    #[error("Invalid interop data length. Expected {0}, got {1}")]
50    InvalidInteropLength(usize, usize),
51}