Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renamed OptimismInvalidTransactionError to OpInvalidTransactionError #12384

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions crates/optimism/rpc/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub enum OpEthApiError {
L1BlockGasError,
/// Wrapper for [`revm_primitives::InvalidTransaction`](InvalidTransaction).
#[error(transparent)]
InvalidTransaction(#[from] OptimismInvalidTransactionError),
InvalidTransaction(#[from] OpInvalidTransactionError),
/// Sequencer client error.
#[error(transparent)]
Sequencer(#[from] SequencerClientError),
Expand Down Expand Up @@ -55,7 +55,7 @@ impl From<OpEthApiError> for jsonrpsee_types::error::ErrorObject<'static> {

/// Optimism specific invalid transaction errors
#[derive(thiserror::Error, Debug)]
pub enum OptimismInvalidTransactionError {
pub enum OpInvalidTransactionError {
/// A deposit transaction was submitted as a system transaction post-regolith.
#[error("no system transactions allowed after regolith")]
DepositSystemTxPostRegolith,
Expand All @@ -64,18 +64,18 @@ pub enum OptimismInvalidTransactionError {
HaltedDepositPostRegolith,
}

impl From<OptimismInvalidTransactionError> for jsonrpsee_types::error::ErrorObject<'static> {
fn from(err: OptimismInvalidTransactionError) -> Self {
impl From<OpInvalidTransactionError> for jsonrpsee_types::error::ErrorObject<'static> {
fn from(err: OpInvalidTransactionError) -> Self {
match err {
OptimismInvalidTransactionError::DepositSystemTxPostRegolith |
OptimismInvalidTransactionError::HaltedDepositPostRegolith => {
OpInvalidTransactionError::DepositSystemTxPostRegolith |
OpInvalidTransactionError::HaltedDepositPostRegolith => {
rpc_err(EthRpcErrorCode::TransactionRejected.code(), err.to_string(), None)
}
}
}
}

impl TryFrom<InvalidTransaction> for OptimismInvalidTransactionError {
impl TryFrom<InvalidTransaction> for OpInvalidTransactionError {
type Error = InvalidTransaction;

fn try_from(err: InvalidTransaction) -> Result<Self, Self::Error> {
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ pub mod error;
pub mod eth;
pub mod sequencer;

pub use error::{OpEthApiError, OptimismInvalidTransactionError, SequencerClientError};
pub use error::{OpEthApiError, OpInvalidTransactionError, SequencerClientError};
pub use eth::{OpEthApi, OpReceiptBuilder};
pub use sequencer::SequencerClient;
Loading