#[non_exhaustive]pub enum ContractsError {
Show 27 variants
Core(CoreError),
Cancelled,
UnsupportedChain(u64),
DeploymentNotFound {
contract: &'static str,
chain_id: u64,
},
InvalidOrderUidLength {
actual: usize,
},
UnsupportedSigningScheme(u8),
UnknownOrderMarker(B256),
UnexpectedEventTopics {
event: &'static str,
},
InvalidEip1271SignatureData,
UnsupportedEip1271Verifier {
verifier: Address,
},
Eip1271Provider {
operation: &'static str,
message: Redacted<String>,
},
MalformedEip1271Response {
response: Redacted<String>,
},
Eip1271MagicValueMismatch {
expected: [u8; 4],
actual: [u8; 4],
},
ZeroReceiver,
Provider {
operation: &'static str,
message: Redacted<String>,
},
Abi(Error),
DecodeHex {
field: &'static str,
source: FromHexError,
},
InvalidHexPrefix {
field: &'static str,
},
InvalidDecodedLength {
field: &'static str,
expected: usize,
actual: usize,
},
FieldTooLarge {
field: &'static str,
max_bytes: usize,
},
Serialization {
category: &'static str,
line: usize,
column: usize,
},
InvalidSignatureLength {
actual: usize,
},
InvalidSignatureRecoveryByte {
value: u8,
},
SignatureSchemeNotEcdsa,
SignatureRecovery {
message: Redacted<String>,
},
TwapValidation(TwapValidationError),
Multiplexer(MultiplexerError),
}Expand description
Errors returned by low-level CoW contract helpers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Core(CoreError)
Core validation failed for an input value.
Cancelled
A long-running contracts operation was cancelled through a cooperative cancellation token.
UnsupportedChain(u64)
A chain id is outside the supported CoW deployment set.
DeploymentNotFound
No canonical deployment of the named contract is registered for the chain/environment pair.
Fields
InvalidOrderUidLength
An order UID had the wrong encoded byte length.
UnsupportedSigningScheme(u8)
A signing-scheme discriminator was not recognized.
UnknownOrderMarker(B256)
An order-kind or token-balance marker decoded from an on-chain
OrderPlacement event did not match any canonical GPv2 label hash.
UnexpectedEventTopics
An on-chain event log carried a topic set that did not match the expected event signature hash or indexed-parameter arity.
InvalidEip1271SignatureData
An encoded EIP-1271 signature payload was malformed.
UnsupportedEip1271Verifier
A verifier address did not have contract bytecode.
Eip1271Provider
The provider failed during an EIP-1271 operation.
Fields
MalformedEip1271Response
The EIP-1271 call response could not be decoded.
Eip1271MagicValueMismatch
The verifier returned an unexpected EIP-1271 magic value.
Fields
ZeroReceiver
Contract orders cannot use the zero address as a receiver.
Provider
Provider operation failed outside the EIP-1271 helpers.
Fields
Abi(Error)
ABI encoding or decoding failed through the alloy-sol-types surface.
DecodeHex
Hex decoding failed for a named field; the underlying
alloy_primitives::hex::FromHexError is preserved in the error-source chain.
Fields
source: FromHexErrorTyped hex-decode error sourced from the decoder.
InvalidHexPrefix
A hexadecimal payload was not 0x-prefixed.
InvalidDecodedLength
A hexadecimal payload decoded to an unexpected byte length.
Fields
FieldTooLarge
A hexadecimal payload exceeded the maximum decoded byte length permitted for its field.
Fields
Serialization
JSON serialization or decoding failed.
Only the serde failure category and the structural position are
surfaced. The raw serde_json::Error rendering can echo bytes from a
decoded payload, so the conversion drops it (ADR 0025); the
category/line/column triple is the safe structural diagnostic,
mirroring cow_sdk_orderbook::OrderbookError::Serialization.
Fields
InvalidSignatureLength
Signature byte length is not the required 65.
InvalidSignatureRecoveryByte
Recovery byte is outside the accepted {0, 1, 27, 28} set.
SignatureSchemeNotEcdsa
A non-ECDSA signature variant was passed to an ECDSA-only helper.
SignatureRecovery
ECDSA public-key recovery failed.
TwapValidation(TwapValidationError)
composable only.Composable TWAP inputs failed client-side validation.
Multiplexer(MultiplexerError)
composable only.A composable conditional-order multiplexer operation failed.
Implementations§
Source§impl ContractsError
impl ContractsError
Sourcepub const fn class(&self) -> ErrorClass
pub const fn class(&self) -> ErrorClass
Returns the coarse-grained ErrorClass for this error.
Trait Implementations§
Source§impl Debug for ContractsError
impl Debug for ContractsError
Source§impl Display for ContractsError
impl Display for ContractsError
Source§impl Error for ContractsError
impl Error for ContractsError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Cancelled> for ContractsError
impl From<Cancelled> for ContractsError
Source§impl From<CoreError> for ContractsError
impl From<CoreError> for ContractsError
Source§impl From<Error> for ContractsError
impl From<Error> for ContractsError
Source§impl From<Error> for ContractsError
impl From<Error> for ContractsError
Source§impl From<MultiplexerError> for ContractsError
impl From<MultiplexerError> for ContractsError
Source§fn from(source: MultiplexerError) -> Self
fn from(source: MultiplexerError) -> Self
Source§impl From<TwapValidationError> for ContractsError
impl From<TwapValidationError> for ContractsError
Source§fn from(source: TwapValidationError) -> Self
fn from(source: TwapValidationError) -> Self
Auto Trait Implementations§
impl Freeze for ContractsError
impl RefUnwindSafe for ContractsError
impl Send for ContractsError
impl Sync for ContractsError
impl Unpin for ContractsError
impl UnsafeUnpin for ContractsError
impl UnwindSafe for ContractsError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.