Intercepts pending-tx RPCs (error or null) or forwards to the inner service.
(service: &S, req: Request<'a>)
| 260 | |
| 261 | /// Intercepts pending-tx RPCs (error or null) or forwards to the inner service. |
| 262 | async fn intercept_or_forward<'a, S>(service: &S, req: Request<'a>) -> MethodResponse |
| 263 | where |
| 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. |
no test coverage detected