Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
refactor: Fix clippy::non-snake-case
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Asseman <[email protected]>
  • Loading branch information
aasseman committed Jul 20, 2023
1 parent e6754aa commit 0dc4be8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions service/src/graph_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl GraphNodeInstance {

let response = request.send().await?.text().await?;
Ok(UnattestedQueryResult {
graphQLResponse: response,
graphql_response: response,
attestable: true,
})
}
Expand All @@ -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,
})
}
Expand Down
10 changes: 5 additions & 5 deletions service/src/query_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand All @@ -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<u8> = vec![0x12, 0x20];
bytes.extend(value.as_bytes().to_vec());
Expand All @@ -78,13 +78,13 @@ pub struct Signature {
}

pub struct QueryResult {
graphQLResponse: String,
graphql_response: String,
attestation: Option<Signature>,
}

#[derive(Debug, Clone)]
pub struct UnattestedQueryResult {
pub graphQLResponse: String,
pub graphql_response: String,
pub attestable: bool,
}

Expand Down
2 changes: 1 addition & 1 deletion service/src/server/routes/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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([(
Expand Down
2 changes: 1 addition & 1 deletion service/src/server/routes/subgraphs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0dc4be8

Please sign in to comment.