Skip to content

Commit

Permalink
feat: move constants
Browse files Browse the repository at this point in the history
  • Loading branch information
leruaa committed May 30, 2024
1 parent faeb630 commit 89835c3
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/node-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ reth-network-p2p.workspace = true
reth-rpc-builder.workspace = true
reth-rpc.workspace = true
reth-rpc-types.workspace = true
reth-rpc-server-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-rpc-api = { workspace = true, features = ["client"] }
reth-transaction-pool.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/node-core/src/args/gas_price_oracle.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::primitives::U256;
use clap::Args;
use reth_rpc::eth::gas_oracle::GasPriceOracleConfig;
use reth_rpc_builder::constants::{
use reth_rpc_server_types::constants::{
DEFAULT_GAS_PRICE_BLOCKS, DEFAULT_GAS_PRICE_PERCENTILE, DEFAULT_IGNORE_GAS_PRICE,
DEFAULT_MAX_GAS_PRICE,
};
Expand Down
3 changes: 2 additions & 1 deletion crates/node-core/src/args/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ use reth_rpc::eth::{
cache::EthStateCacheConfig, gas_oracle::GasPriceOracleConfig, RPC_DEFAULT_GAS_CAP,
};
use reth_rpc_builder::{
auth::AuthServerConfig, constants, error::RpcError, EthConfig, Identity, IpcServerBuilder,
auth::AuthServerConfig, error::RpcError, EthConfig, Identity, IpcServerBuilder,
RethRpcModule, RpcModuleConfig, RpcModuleSelection, RpcServerConfig, ServerBuilder,
TransportRpcModuleConfig,
};
use reth_rpc_server_types::constants;
use std::{
ffi::OsStr,
net::{IpAddr, Ipv4Addr, SocketAddr},
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ reth-provider.workspace = true
reth-rpc.workspace = true
reth-rpc-api.workspace = true
reth-rpc-layer.workspace = true
reth-rpc-server-types.workspace = true
reth-tasks = { workspace = true, features = ["rayon"] }
reth-transaction-pool.workspace = true
reth-evm.workspace = true
Expand Down
6 changes: 4 additions & 2 deletions crates/rpc/rpc-builder/src/auth.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use crate::{
constants,
constants::{DEFAULT_MAX_BLOCKS_PER_FILTER, DEFAULT_MAX_LOGS_PER_RESPONSE},
error::{RpcError, ServerKind},
EthConfig,
};
Expand Down Expand Up @@ -35,6 +33,10 @@ use reth_rpc_layer::{
secret_to_bearer_header, AuthClientLayer, AuthClientService, AuthLayer, JwtAuthValidator,
JwtSecret,
};
use reth_rpc_server_types::{
constants,
constants::{DEFAULT_MAX_BLOCKS_PER_FILTER, DEFAULT_MAX_LOGS_PER_RESPONSE},
};
use reth_tasks::{pool::BlockingTaskPool, TaskSpawner};
use reth_transaction_pool::TransactionPool;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-builder/src/eth.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants::{
use reth_rpc_server_types::constants::{
default_max_tracing_requests, DEFAULT_MAX_BLOCKS_PER_FILTER, DEFAULT_MAX_LOGS_PER_RESPONSE,
};
use reth_rpc::{
Expand Down
5 changes: 1 addition & 4 deletions crates/rpc/rpc-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ use crate::{
auth::AuthRpcModule, cors::CorsDomainError, error::WsHttpSamePortError,
metrics::RpcRequestMetrics, RpcModuleSelection::Selection,
};
use constants::*;
use error::{ConflictingModules, RpcError, ServerKind};
use hyper::{header::AUTHORIZATION, HeaderMap};
pub use jsonrpsee::server::ServerBuilder;
Expand Down Expand Up @@ -192,6 +191,7 @@ use reth_rpc::{
};
use reth_rpc_api::servers::*;
use reth_rpc_layer::{AuthLayer, Claims, JwtAuthValidator, JwtSecret};
use reth_rpc_server_types::constants::*;
use reth_tasks::{
pool::{BlockingTaskGuard, BlockingTaskPool},
TaskSpawner, TokioTaskExecutor,
Expand Down Expand Up @@ -226,9 +226,6 @@ pub mod error;
/// Eth utils
mod eth;

/// Common RPC constants.
pub mod constants;

// Rpc server metrics
mod metrics;

Expand Down
2 changes: 2 additions & 0 deletions crates/rpc/rpc-server-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ description = "RPC server types and constants"
workspace = true

[dependencies]
# reth
reth-rpc.workspace = true
File renamed without changes.
2 changes: 2 additions & 0 deletions crates/rpc/rpc-server-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
//! Reth RPC server types.

/// Common RPC constants.
pub mod constants;

0 comments on commit 89835c3

Please sign in to comment.