use alloy_primitives::{Address, U256};
#[derive(Debug, Clone)]
pub enum InvalidTransaction {
InvalidEncoding,
InvalidStructure,
PriorityFeeGreaterThanMaxFee,
BaseFeeGreaterThanMaxFee,
GasPriceLessThanBasefee,
CallerGasLimitMoreThanBlock,
CallerGasLimitMoreThanTxLimit,
CallGasCostMoreThanGasLimit,
RejectCallerWithCode,
LackOfFundForMaxFee {
fee: U256,
balance: U256,
},
OverflowPaymentInTransaction,
NonceOverflowInTransaction,
NonceTooHigh {
tx: u64,
state: u64,
},
NonceTooLow {
tx: u64,
state: u64,
},
MalleableSignature,
IncorrectFrom {
tx: Address,
recovered: Address,
},
CreateInitCodeSizeLimit,
InvalidChainId,
AccessListNotSupported,
AuthListIsEmpty,
PubdataPriceTooHigh,
BlockGasLimitTooHigh,
UpgradeTxNotFirst,
EIP7623IntrinsicGasIsTooLow,
NativeResourcesAreTooExpensive,
Revert {
method: AAMethod,
output: Option<&'static [u8]>,
},
ReceivedInsufficientFees {
received: U256,
required: U256,
},
InvalidMagic,
InvalidReturndataLength,
OutOfGasDuringValidation,
OutOfNativeResourcesDuringValidation,
NonceUsedAlready,
NonceNotIncreased,
PaymasterReturnDataTooShort,
PaymasterInvalidMagic,
PaymasterContextInvalid,
PaymasterContextOffsetTooLong,
BlockGasLimitReached,
BlockBlobGasLimitReached,
BlockNativeLimitReached,
BlockPubdataLimitReached,
BlockL2ToL1LogsLimitReached,
EIP7702HasNullDestination,
CallerGasLimitTooHigh,
BlobElementIsNotSupported,
BlobBaseFeeGreaterThanMaxFeePerBlobGas,
BlobListTooLong,
EmptyBlobList,
OtherLimitReached(String),
OtherUnrecoverable(String),
FilteredByValidator,
}
#[derive(Debug, Clone)]
pub enum AAMethod {
AccountValidate,
AccountPayForTransaction,
AccountPrePaymaster,
PaymasterValidateAndPay,
}
impl core::fmt::Display for InvalidTransaction {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{self:?}")
}
}