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

use result for TransactionCompact::fill. #12170

Merged
Prev Previous commit
Next Next commit
fix suggestions
lakshya-sky committed Nov 4, 2024
commit 279fe00e7ed5c615da80d4820fe726197ab534f6
2 changes: 2 additions & 0 deletions crates/optimism/rpc/src/eth/transaction.rs
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@ pub enum TransactionError {
ProviderError(ProviderError),
}

impl core::error::Error for TransactionError {}

impl<N> EthTransactions for OpEthApi<N>
where
Self: LoadTransaction<Provider: BlockReaderIdExt>,
3 changes: 2 additions & 1 deletion crates/rpc/rpc-types-compat/src/transaction/mod.rs
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ mod signature;

pub use signature::*;

use core::error;
use std::fmt;

use alloy_consensus::Transaction as _;
@@ -48,7 +49,7 @@ pub trait TransactionCompat: Send + Sync + Unpin + Clone + fmt::Debug {
+ fmt::Debug;

/// RPC transaction error type.
type TransactionError: fmt::Debug;
type TransactionError: error::Error;

///
/// Formats gas price and max fee per gas for RPC transaction response w.r.t. network specific
4 changes: 3 additions & 1 deletion crates/rpc/rpc/src/eth/helpers/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! L1 `eth` API types.

use std::convert::Infallible;

use alloy_consensus::Transaction as _;
use alloy_network::{Ethereum, Network};
use alloy_primitives::{Address, TxKind};
@@ -20,7 +22,7 @@ where
{
type Transaction = <Ethereum as Network>::TransactionResponse;

type TransactionError = ();
type TransactionError = Infallible;

fn fill(
&self,