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

feat: add L2EthApiExt trait #13539

Merged
merged 3 commits into from
Dec 24, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: add L2EthApiExt trait
mattsse committed Dec 24, 2024

Verified

This commit was signed with the committer’s verified signature.
nonrational Alan Norton
commit 35917d86773af00e97299d2077c2e262ee1a197b
5 changes: 3 additions & 2 deletions crates/rpc/rpc-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ pub mod servers {
};
pub use reth_rpc_eth_api::{
self as eth, EthApiServer, EthBundleApiServer, EthCallBundleApiServer, EthFilterApiServer,
EthPubSubApiServer, L2EthApiExtServer
EthPubSubApiServer, L2EthApiExtServer,
};
}

@@ -83,6 +83,7 @@ pub mod clients {
web3::Web3ApiClient,
};
pub use reth_rpc_eth_api::{
EthApiClient, EthBundleApiClient, EthCallBundleApiClient, EthFilterApiClient, L2EthApiExtServer
EthApiClient, EthBundleApiClient, EthCallBundleApiClient, EthFilterApiClient,
L2EthApiExtServer,
};
}
7 changes: 5 additions & 2 deletions crates/rpc/rpc-eth-api/src/ext.rs
Original file line number Diff line number Diff line change
@@ -9,8 +9,11 @@ use jsonrpsee::{core::RpcResult, proc_macros::rpc};
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "eth"))]
pub trait L2EthApiExt<T: RpcObject> {

/// Sends signed transaction with the given condition.
#[method(name = "sendRawTransactionConditional")]
async fn send_raw_transaction(&self, bytes: Bytes, condtion: ConditionalOptions) -> RpcResult<B256>;
async fn send_raw_transaction_conditional(
&self,
bytes: Bytes,
condition: ConditionalOptions,
) -> RpcResult<B256>;
}
8 changes: 4 additions & 4 deletions crates/rpc/rpc-eth-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -14,17 +14,17 @@

pub mod bundle;
pub mod core;
pub mod ext;
pub mod filter;
pub mod helpers;
pub mod node;
pub mod pubsub;
pub mod types;
pub mod ext;

pub use bundle::{EthBundleApiServer, EthCallBundleApiServer};
pub use core::{EthApiServer, FullEthApiServer};
pub use filter::EthFilterApiServer;
pub use ext::L2EthApiExtServer;
pub use filter::EthFilterApiServer;
pub use node::{RpcNodeCore, RpcNodeCoreExt};
pub use pubsub::EthPubSubApiServer;
pub use reth_rpc_eth_types::error::{
@@ -38,8 +38,8 @@ pub use bundle::{EthBundleApiClient, EthCallBundleApiClient};
#[cfg(feature = "client")]
pub use core::EthApiClient;
#[cfg(feature = "client")]
pub use filter::EthFilterApiClient;
#[cfg(feature = "client")]
pub use ext::L2EthApiExtClient;
#[cfg(feature = "client")]
pub use filter::EthFilterApiClient;

use reth_trie_common as _;