Skip to content

Commit 9f336c7

Browse files
Evalirprestwich
authored andcommitted
chore: move stuff around for the new endpoints
1 parent 38c2133 commit 9f336c7

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

crates/rpc/src/ctx.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::{
2-
eth::{EthError, TxCacheForwarder},
2+
eth::EthError,
33
interest::{ActiveFilter, FilterManager, FilterOutput, SubscriptionManager},
44
util::BlockRangeInclusiveIter,
5-
Pnt,
5+
Pnt, TxCacheForwarder,
66
};
77
use alloy::{
88
consensus::{BlockHeader, Header, Signed, Transaction, TxEnvelope},

crates/rpc/src/eth/endpoints.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::{
22
ctx::RpcCtx,
33
eth::{CallErrorData, EthError},
44
interest::{FilterOutput, InterestKind},
5+
util::await_jh_option,
56
Pnt,
67
};
78
use ajj::{HandlerCtx, ResponsePayload};
@@ -31,15 +32,6 @@ use std::borrow::Cow;
3132
use tracing::{trace_span, Instrument};
3233
use trevm::revm::context::result::ExecutionResult;
3334

34-
macro_rules! await_jh_option {
35-
($h:expr) => {
36-
match $h.await {
37-
Ok(Some(res)) => res,
38-
_ => return Err("task panicked or cancelled".to_string()),
39-
}
40-
};
41-
}
42-
4335
macro_rules! await_jh_option_response {
4436
($h:expr) => {
4537
match $h.await {

crates/rpc/src/eth/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ use endpoints::*;
44
mod error;
55
pub use error::EthError;
66

7-
mod forwarder;
8-
pub use forwarder::TxCacheForwarder;
9-
107
mod helpers;
118
pub use helpers::CallErrorData;
129

crates/rpc/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ mod ctx;
4747
pub use ctx::RpcCtx;
4848

4949
mod eth;
50-
pub use eth::{eth, CallErrorData, EthError, TxCacheForwarder};
50+
pub use eth::{eth, CallErrorData, EthError};
5151

5252
mod signet;
5353
pub use signet::signet;
5454

5555
mod interest;
5656

57+
mod forwarder;
58+
use forwarder::TxCacheForwarder;
59+
5760
pub(crate) mod util;
5861
pub use util::Pnt;
5962

crates/rpc/src/util.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ use reth::{primitives::EthPrimitives, providers::providers::ProviderNodeTypes};
22
use reth_chainspec::ChainSpec;
33
use std::{iter::StepBy, ops::RangeInclusive};
44

5+
macro_rules! await_jh_option {
6+
($h:expr) => {
7+
match $h.await {
8+
Ok(Some(res)) => res,
9+
_ => return Err("task panicked or cancelled".to_string()),
10+
}
11+
};
12+
}
13+
pub(crate) use await_jh_option;
14+
515
/// Convenience trait for specifying the [`ProviderNodeTypes`] implementation
616
/// required for Signet RPC functionality.
717
pub trait Pnt: ProviderNodeTypes<ChainSpec = ChainSpec, Primitives = EthPrimitives> {}

0 commit comments

Comments
 (0)