Skip to content

Move rpc compat into OpEthApi #16498

@mattsse

Description

@mattsse

Describe the feature

for #16451 we should do the same for OpEthapi as we did for ethapi:

pub struct EthApi<Provider: BlockReader, Pool, Network, EvmConfig> {
/// All nested fields bundled together.
#[deref]
pub(super) inner: Arc<EthApiInner<Provider, Pool, Network, EvmConfig>>,
/// Transaction RPC response builder.
pub tx_resp_builder: EthTxBuilder,

fn tx_resp_builder(&self) -> &Self::TransactionCompat {
&self.tx_resp_builder
}

instead of for OpEthapi

fn tx_resp_builder(&self) -> &Self::TransactionCompat {
self
}

impl<N> TransactionCompat<OpTransactionSigned> for OpEthApi<N>

this way we can decouple the rpc response and the txtype:

tx: Recovered<OpTransactionSigned>,

and make this a configurable on OpEthapi itself

Additional context

No response

Metadata

Metadata

Assignees

Labels

A-op-rethRelated to Optimism and op-rethA-sdkRelated to reth's use as a libraryC-enhancementNew feature or request

Type

No type

Projects

Status

Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions