Skip to content

Commit dc3b3d6

Browse files
committed
refactor: move extra routes to routes mod
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent fd8887c commit dc3b3d6

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed
File renamed without changes.

crates/service/src/routes/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
pub mod cost;
55
pub mod dips;
6+
mod health;
7+
mod request_handler;
8+
mod static_subgraph;
69
mod status;
710

11+
pub use health::health;
12+
pub use request_handler::request_handler;
13+
pub use static_subgraph::static_subgraph_request_handler;
814
pub use status::status;

crates/service/src/service/request_handler.rs renamed to crates/service/src/routes/request_handler.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ use tap_core::receipt::Context;
1818
use thegraph_core::DeploymentId;
1919
use tracing::trace;
2020

21-
use super::{
22-
indexer_service::{AttestationOutput, IndexerServiceError, IndexerServiceState},
23-
tap_receipt_header::TapReceipt,
24-
IndexerServiceImpl, IndexerServiceResponse,
21+
use crate::service::{
22+
AttestationOutput, IndexerServiceError, IndexerServiceImpl, IndexerServiceResponse,
23+
IndexerServiceState, TapReceipt,
2524
};
2625

2726
lazy_static! {

crates/service/src/service/static_subgraph.rs renamed to crates/service/src/routes/static_subgraph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use tracing::warn;
66

77
use indexer_common::SubgraphClient;
88

9-
use super::{indexer_service::IndexerServiceError, IndexerServiceImpl};
9+
use crate::service::{IndexerServiceError, IndexerServiceImpl};
1010

1111
#[autometrics::autometrics]
1212
pub async fn static_subgraph_request_handler<I>(

crates/service/src/service.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ use crate::{
2828
dips::{AgreementStore, InMemoryAgreementStore},
2929
},
3030
routes::dips::Price,
31-
service::indexer_service::{
32-
AttestationOutput, IndexerService, IndexerServiceImpl, IndexerServiceOptions,
33-
IndexerServiceRelease, IndexerServiceResponse,
34-
},
31+
service::indexer_service::{IndexerService, IndexerServiceOptions, IndexerServiceRelease},
3532
};
3633
use clap::Parser;
3734
use tracing::error;
3835

39-
mod health;
4036
mod indexer_service;
41-
mod request_handler;
42-
mod static_subgraph;
4337
mod tap_receipt_header;
4438

39+
pub use indexer_service::{
40+
AttestationOutput, IndexerServiceError, IndexerServiceImpl, IndexerServiceResponse,
41+
IndexerServiceState,
42+
};
43+
pub use tap_receipt_header::TapReceipt;
44+
4545
#[derive(Debug)]
4646
struct SubgraphServiceResponse {
4747
inner: String,

crates/service/src/service/indexer_service.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ use tower_governor::{governor::GovernorConfigBuilder, GovernorLayer};
3939
use tower_http::{cors, cors::CorsLayer, normalize_path::NormalizePath, trace::TraceLayer};
4040
use tracing::{error, info, info_span};
4141

42-
use super::request_handler::request_handler;
43-
use super::{health::health, static_subgraph::static_subgraph_request_handler};
42+
use crate::routes::health;
43+
use crate::routes::request_handler;
44+
use crate::routes::static_subgraph_request_handler;
4445
use crate::tap::IndexerTapContext;
4546
use indexer_config::Config;
4647

0 commit comments

Comments
 (0)