signet_types/signing/
error.rs

1/// An error that can occur when validating a signed order or fill.
2#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
3pub enum SignedPermitError {
4    /// Mismatched permits and outputs.
5    #[error("Permits and Outputs do not match.")]
6    PermitMismatch,
7    /// The deadline for the order has passed.
8    #[error("Deadline has passed: current time is: {current}, deadline was: {deadline}")]
9    DeadlinePassed {
10        /// The current timestamp.
11        current: u64,
12        /// The deadline for the [`Permit2Batch`].
13        deadline: u64,
14    },
15}
16
17/// An error that can occur when signing an Order or a Fill.
18#[derive(Debug, thiserror::Error)]
19pub enum SigningError {
20    /// Missing chain config.
21    #[error(
22        "Target chain id is missing. Populate it by calling with_chain before attempting to sign"
23    )]
24    MissingChainId,
25    /// Missing rollup chain id for a Fill.
26    #[error(
27        "Rollup chain id is missing. Populate it by calling with_chain before attempting to sign"
28    )]
29    #[deprecated(since = "0.14.1", note = "Use MissingChainId instead.")]
30    MissingRollupChainId,
31    /// Missing chain config for a specific chain.
32    #[error("Target Order contract address is missing for chain id {0}. Populate it by calling with_chain before attempting to sign")]
33    MissingOrderContract(u64),
34    /// Error signing the order hash.
35    #[error(transparent)]
36    Signer(#[from] alloy::signers::Error),
37}