From 0dc4be8e64cc5914b47938c1d90f286bd8f54770 Mon Sep 17 00:00:00 2001 From: Alexis Asseman Date: Thu, 20 Jul 2023 10:57:21 -0700 Subject: [PATCH] refactor: Fix clippy::non-snake-case Signed-off-by: Alexis Asseman --- service/src/graph_node.rs | 4 ++-- service/src/query_processor.rs | 10 +++++----- service/src/server/routes/network.rs | 2 +- service/src/server/routes/subgraphs.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/service/src/graph_node.rs b/service/src/graph_node.rs index cdcdc6d..439c5a8 100644 --- a/service/src/graph_node.rs +++ b/service/src/graph_node.rs @@ -33,7 +33,7 @@ impl GraphNodeInstance { let response = request.send().await?.text().await?; Ok(UnattestedQueryResult { - graphQLResponse: response, + graphql_response: response, attestable: true, }) } @@ -54,7 +54,7 @@ impl GraphNodeInstance { // actually parse the JSON for the graphQL schema let response_text = response.text().await?; Ok(UnattestedQueryResult { - graphQLResponse: response_text, + graphql_response: response_text, attestable: false, }) } diff --git a/service/src/query_processor.rs b/service/src/query_processor.rs index 2ea1fd6..9037d16 100644 --- a/service/src/query_processor.rs +++ b/service/src/query_processor.rs @@ -29,12 +29,12 @@ impl ToString for SubgraphName { } /// Security: Input validation -pub fn bytes32Check() -> Regex { +pub fn bytes32_check() -> Regex { Regex::new(r"^0x[0-9a-f]{64}$").unwrap() } /// Security: Input Validation -pub fn multiHashCheck() -> Regex { +pub fn multihash_check() -> Regex { Regex::new(r"^Qm[1-9a-km-zA-HJ-NP-Z]{44}$").unwrap() } @@ -57,7 +57,7 @@ impl SubgraphDeploymentID { self.value.clone() } - fn ipfsHash(&self) -> String { + fn ipfs_hash(&self) -> String { let value = self.value.clone(); let mut bytes: Vec = vec![0x12, 0x20]; bytes.extend(value.as_bytes().to_vec()); @@ -78,13 +78,13 @@ pub struct Signature { } pub struct QueryResult { - graphQLResponse: String, + graphql_response: String, attestation: Option, } #[derive(Debug, Clone)] pub struct UnattestedQueryResult { - pub graphQLResponse: String, + pub graphql_response: String, pub attestable: bool, } diff --git a/service/src/server/routes/network.rs b/service/src/server/routes/network.rs index 489cb6d..7547ca4 100644 --- a/service/src/server/routes/network.rs +++ b/service/src/server/routes/network.rs @@ -40,7 +40,7 @@ pub async fn network_queries( // take response and send back as json match request.status { 200 => { - let response_body = request.result.graphQLResponse; + let response_body = request.result.graphql_response; ( StatusCode::OK, axum::response::AppendHeaders([( diff --git a/service/src/server/routes/subgraphs.rs b/service/src/server/routes/subgraphs.rs index 7e3a17c..c0fceff 100644 --- a/service/src/server/routes/subgraphs.rs +++ b/service/src/server/routes/subgraphs.rs @@ -66,7 +66,7 @@ pub async fn subgraph_queries( // take response and send back as json match res.status { 200 => { - let response_body = res.result.graphQLResponse; + let response_body = res.result.graphql_response; let attestable = res.result.attestable.to_string(); ( StatusCode::OK,