mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 09:08:05 -05:00
chore: add InvalidChainId error variant (#1657)
This commit is contained in:
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -5160,7 +5160,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "revm"
|
||||
version = "3.0.0"
|
||||
source = "git+https://github.com/bluealloy/revm#3a17ca8556ee2933100d1e1ed4e200712715f76f"
|
||||
source = "git+https://github.com/bluealloy/revm#7bb73da23d0278829f9669f175a6eede247c0538"
|
||||
dependencies = [
|
||||
"auto_impl",
|
||||
"revm-interpreter",
|
||||
@@ -5170,7 +5170,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "revm-interpreter"
|
||||
version = "1.0.0"
|
||||
source = "git+https://github.com/bluealloy/revm#3a17ca8556ee2933100d1e1ed4e200712715f76f"
|
||||
source = "git+https://github.com/bluealloy/revm#7bb73da23d0278829f9669f175a6eede247c0538"
|
||||
dependencies = [
|
||||
"bitvec 1.0.1",
|
||||
"derive_more",
|
||||
@@ -5182,7 +5182,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "revm-precompile"
|
||||
version = "2.0.0"
|
||||
source = "git+https://github.com/bluealloy/revm#3a17ca8556ee2933100d1e1ed4e200712715f76f"
|
||||
source = "git+https://github.com/bluealloy/revm#7bb73da23d0278829f9669f175a6eede247c0538"
|
||||
dependencies = [
|
||||
"k256",
|
||||
"num",
|
||||
@@ -5198,7 +5198,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "revm-primitives"
|
||||
version = "1.0.0"
|
||||
source = "git+https://github.com/bluealloy/revm#3a17ca8556ee2933100d1e1ed4e200712715f76f"
|
||||
source = "git+https://github.com/bluealloy/revm#7bb73da23d0278829f9669f175a6eede247c0538"
|
||||
dependencies = [
|
||||
"arbitrary",
|
||||
"auto_impl",
|
||||
|
||||
@@ -179,15 +179,17 @@ pub enum InvalidTransactionError {
|
||||
/// Unspecific evm halt error
|
||||
#[error("EVM error {0:?}")]
|
||||
EvmHalt(Halt),
|
||||
#[error("Invalid chain id")]
|
||||
InvalidChainId,
|
||||
}
|
||||
|
||||
impl InvalidTransactionError {
|
||||
/// Returns the rpc error code for this error.
|
||||
fn error_code(&self) -> i32 {
|
||||
match self {
|
||||
InvalidTransactionError::GasTooLow | InvalidTransactionError::GasTooHigh => {
|
||||
EthRpcErrorCode::InvalidInput.code()
|
||||
}
|
||||
InvalidTransactionError::InvalidChainId |
|
||||
InvalidTransactionError::GasTooLow |
|
||||
InvalidTransactionError::GasTooHigh => EthRpcErrorCode::InvalidInput.code(),
|
||||
InvalidTransactionError::Revert(_) => EthRpcErrorCode::ExecutionError.code(),
|
||||
_ => EthRpcErrorCode::TransactionRejected.code(),
|
||||
}
|
||||
@@ -214,6 +216,7 @@ impl From<revm::primitives::InvalidTransaction> for InvalidTransactionError {
|
||||
fn from(err: revm::primitives::InvalidTransaction) -> Self {
|
||||
use revm::primitives::InvalidTransaction;
|
||||
match err {
|
||||
InvalidTransaction::InvalidChainId => InvalidTransactionError::InvalidChainId,
|
||||
InvalidTransaction::GasMaxFeeGreaterThanPriorityFee => {
|
||||
InvalidTransactionError::TipAboveFeeCap
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user