Skip to content
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
26 changes: 1 addition & 25 deletions crates/rpc/src/signet/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,12 @@ use crate::{
};
use ajj::{HandlerCtx, ResponsePayload};
use reth_node_api::FullNodeComponents;
use signet_bundle::{
SignetBundleDriver, SignetCallBundle, SignetCallBundleResponse, SignetEthBundle,
};
use signet_bundle::{SignetBundleDriver, SignetCallBundle, SignetCallBundleResponse};
use signet_node_types::Pnt;
use signet_types::SignedOrder;
use std::time::Duration;
use tokio::select;

pub(super) async fn send_bundle<Host, Signet>(
hctx: HandlerCtx,
bundle: SignetEthBundle,
ctx: RpcCtx<Host, Signet>,
) -> Result<(), String>
where
Host: FullNodeComponents,
Signet: Pnt,
{
let task = |hctx: HandlerCtx| async move {
let Some(tx_cache) = ctx.signet().tx_cache() else {
return Err(SignetError::TxCacheUrlNotProvided.into_string());
};

hctx.spawn(async move { tx_cache.forward_bundle(bundle).await.map_err(|e| e.to_string()) });

Ok(())
};

await_handler!(@option hctx.spawn_blocking_with_ctx(task))
}

pub(super) async fn send_order<Host, Signet>(
hctx: HandlerCtx,
order: SignedOrder,
Expand Down
5 changes: 1 addition & 4 deletions crates/rpc/src/signet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ where
Host: FullNodeComponents,
Signet: Pnt,
{
ajj::Router::new()
.route("sendBundle", send_bundle)
.route("sendOrder", send_order)
.route("callBundle", call_bundle)
ajj::Router::new().route("sendOrder", send_order).route("callBundle", call_bundle)
}
Loading