Skip to content

Commit 91130fd

Browse files
committed
refactor: rename middlewares
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent 4db0df2 commit 91130fd

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

crates/service/src/middleware.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
// Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
mod allocation;
45
mod attestation;
6+
mod attestation_signer;
57
pub mod auth;
6-
mod inject_allocation;
7-
mod inject_attestation_signer;
8-
mod inject_context;
9-
mod inject_deployment;
10-
mod inject_labels;
11-
mod inject_receipt;
12-
mod inject_sender;
8+
mod deployment;
9+
mod labels;
1310
mod prometheus_metrics;
11+
mod sender;
12+
mod tap_context;
13+
mod tap_receipt;
1414

15-
pub use inject_allocation::{allocation_middleware, Allocation, AllocationState};
16-
pub use inject_context::context_middleware;
17-
pub use inject_deployment::deployment_middleware;
18-
pub use inject_labels::labels_middleware;
19-
pub use inject_receipt::receipt_middleware;
20-
pub use inject_sender::{sender_middleware, SenderState};
21-
pub use inject_attestation_signer::{signer_middleware, AttestationState};
15+
pub use allocation::{allocation_middleware, Allocation, AllocationState};
2216
pub use attestation::{attestation_middleware, AttestationInput};
17+
pub use attestation_signer::{signer_middleware, AttestationState};
18+
pub use deployment::deployment_middleware;
19+
pub use labels::labels_middleware;
2320
pub use prometheus_metrics::PrometheusMetricsMiddlewareLayer;
21+
pub use sender::{sender_middleware, SenderState};
22+
pub use tap_context::context_middleware;
23+
pub use tap_receipt::receipt_middleware;

crates/service/src/middleware/inject_allocation.rs renamed to crates/service/src/middleware/allocation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub async fn allocation_middleware(
5858

5959
#[cfg(test)]
6060
mod tests {
61-
use crate::middleware::inject_allocation::Allocation;
61+
use crate::middleware::allocation::Allocation;
6262

6363
use super::{allocation_middleware, AllocationState};
6464

crates/service/src/middleware/inject_labels.rs renamed to crates/service/src/middleware/labels.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use axum::{extract::Request, middleware::Next, response::Response};
77
use thegraph_core::DeploymentId;
88

99
use super::{
10-
inject_allocation::Allocation,
11-
inject_sender::Sender,
10+
allocation::Allocation,
11+
sender::Sender,
1212
prometheus_metrics::{MetricLabelProvider, MetricLabels},
1313
};
1414

@@ -81,9 +81,9 @@ pub async fn labels_middleware(mut request: Request, next: Next) -> Response {
8181
#[cfg(test)]
8282
mod tests {
8383
use crate::middleware::{
84-
inject_allocation::Allocation,
85-
inject_labels::{NO_ALLOCATION, NO_DEPLOYMENT_ID, NO_SENDER},
86-
inject_sender::Sender,
84+
allocation::Allocation,
85+
labels::{NO_ALLOCATION, NO_DEPLOYMENT_ID, NO_SENDER},
86+
sender::Sender,
8787
prometheus_metrics::MetricLabels,
8888
};
8989

crates/service/src/middleware/inject_sender.rs renamed to crates/service/src/middleware/sender.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub async fn sender_middleware(
5858

5959
#[cfg(test)]
6060
mod tests {
61-
use crate::middleware::inject_sender::SenderState;
61+
use crate::middleware::sender::SenderState;
6262

6363
use super::{sender_middleware, Sender};
6464
use alloy::primitives::Address;

crates/service/src/middleware/inject_context.rs renamed to crates/service/src/middleware/tap_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ mod tests {
7878
use tower::ServiceExt;
7979

8080
use crate::{
81-
middleware::inject_context::{context_middleware, QueryBody},
81+
middleware::tap_context::{context_middleware, QueryBody},
8282
tap::AgoraQuery,
8383
};
8484

crates/service/src/middleware/inject_receipt.rs renamed to crates/service/src/middleware/tap_receipt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub async fn receipt_middleware(mut request: Request, next: Next) -> Response {
2424

2525
#[cfg(test)]
2626
mod tests {
27-
use crate::{middleware::inject_receipt::receipt_middleware, service::TapReceipt};
27+
use crate::{middleware::tap_receipt::receipt_middleware, service::TapReceipt};
2828

2929
use alloy::primitives::Address;
3030
use axum::{

0 commit comments

Comments
 (0)