MCPcopy Create free account
hub / github.com/circlefin/arc-node / intercept_or_forward

Function intercept_or_forward

crates/evm-node/src/rpc_middleware.rs:262–273  ·  view source on GitHub ↗

Intercepts pending-tx RPCs (error or null) or forwards to the inner service.

(service: &S, req: Request<'a>)

Source from the content-addressed store, hash-verified

260
261/// Intercepts pending-tx RPCs (error or null) or forwards to the inner service.
262async fn intercept_or_forward<'a, S>(service: &S, req: Request<'a>) -> MethodResponse
263where
264 S: RpcServiceT<MethodResponse = MethodResponse> + Send + Sync,
265{
266 if let Err(err) = error_if_pending_tx_rpc(&req) {
267 return MethodResponse::error(req.id(), err);
268 }
269 if is_pool_pending_tx_lookup(&req) || is_pending_block_query(&req) {
270 return null_response(&req);
271 }
272 service.call(req).await
273}
274
275/// RPC middleware that rejects raw transaction submission calls carrying a
276/// pre-EIP-155 (replay-unprotected) transaction.

Callers 2

callMethod · 0.85
batchMethod · 0.85

Calls 6

error_if_pending_tx_rpcFunction · 0.85
is_pending_block_queryFunction · 0.85
null_responseFunction · 0.85
idMethod · 0.80
callMethod · 0.80

Tested by

no test coverage detected