Skip to content

Commit 7330b90

Browse files
committed
chore: add imports format config
Signed-off-by: Lorenzo Delgado <[email protected]>
1 parent 5159de2 commit 7330b90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+362
-325
lines changed

crates/attestation/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ use alloy::{
88
local::{coins_bip39::English, MnemonicBuilder, PrivateKeySigner},
99
},
1010
};
11-
use thegraph_core::{attestation, Address, Attestation, ChainId, DeploymentId};
12-
1311
use indexer_allocation::Allocation;
12+
use thegraph_core::{attestation, Address, Attestation, ChainId, DeploymentId};
1413

1514
pub fn derive_key_pair(
1615
indexer_mnemonic: &str,
@@ -117,12 +116,12 @@ fn wallet_for_allocation(
117116

118117
#[cfg(test)]
119118
mod tests {
120-
use alloy::primitives::U256;
121119
use std::str::FromStr;
122-
use test_log::test;
123120

121+
use alloy::primitives::U256;
124122
use indexer_allocation::{Allocation, AllocationStatus, SubgraphDeployment};
125123
use test_assets::DISPUTE_MANAGER_ADDRESS;
124+
use test_log::test;
126125

127126
use super::*;
128127

crates/config/src/config.rs

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

4-
use bigdecimal::{BigDecimal, FromPrimitive, ToPrimitive};
5-
use figment::{
6-
providers::{Env, Format, Toml},
7-
Figment,
8-
};
9-
use serde_repr::Deserialize_repr;
10-
use serde_with::DurationSecondsWithFrac;
114
use std::{
125
collections::HashMap,
6+
env,
137
net::{Ipv4Addr, SocketAddr, SocketAddrV4},
148
path::PathBuf,
159
str::FromStr,
1610
time::Duration,
1711
};
18-
use tracing::warn;
1912

2013
use alloy::primitives::Address;
14+
use bigdecimal::{BigDecimal, FromPrimitive, ToPrimitive};
2115
use bip39::Mnemonic;
16+
use figment::{
17+
providers::{Env, Format, Toml},
18+
Figment,
19+
};
2220
use regex::Regex;
2321
use serde::Deserialize;
24-
use serde_with::serde_as;
25-
use std::env;
22+
use serde_repr::Deserialize_repr;
23+
use serde_with::{serde_as, DurationSecondsWithFrac};
2624
use thegraph_core::DeploymentId;
25+
use tracing::warn;
2726
use url::Url;
2827

2928
use crate::NonZeroGRT;
@@ -423,15 +422,15 @@ pub struct RavRequestConfig {
423422

424423
#[cfg(test)]
425424
mod tests {
425+
use std::{env, fs, path::PathBuf, str::FromStr};
426+
426427
use alloy::primitives::FixedBytes;
427428
use figment::value::Uncased;
428429
use sealed_test::prelude::*;
429-
use std::{env, fs, path::PathBuf, str::FromStr};
430430
use tracing_test::traced_test;
431431

432-
use crate::{Config, ConfigPrefix};
433-
434432
use super::{DatabaseConfig, SHARED_PREFIX};
433+
use crate::{Config, ConfigPrefix};
435434

436435
#[test]
437436
fn test_minimal_config() {

crates/dips/src/lib.rs

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

4-
use std::str::FromStr;
5-
use std::time::{Duration, SystemTime, UNIX_EPOCH};
4+
use std::{
5+
str::FromStr,
6+
time::{Duration, SystemTime, UNIX_EPOCH},
7+
};
68

79
pub use alloy;
10+
use alloy::{
11+
core::primitives::Address,
12+
primitives::PrimitiveSignature as Signature,
13+
rlp::{RlpDecodable, RlpEncodable},
14+
signers::SignerSync,
15+
};
816
pub use alloy_rlp;
9-
10-
use alloy::core::primitives::Address;
11-
use alloy::rlp::{RlpDecodable, RlpEncodable};
12-
use alloy::{primitives::PrimitiveSignature as Signature, signers::SignerSync};
1317
use alloy_rlp::Encodable;
1418
use thegraph_core::alloy_sol_types::{sol, Eip712Domain, SolStruct};
1519
use thiserror::Error;
@@ -212,9 +216,11 @@ impl SignedCancellationRequest {
212216
mod test {
213217
use std::time::{Duration, SystemTime, UNIX_EPOCH};
214218

215-
use alloy::primitives::{Address, FixedBytes, U256};
216-
use alloy::signers::local::PrivateKeySigner;
217-
use alloy::sol_types::SolStruct;
219+
use alloy::{
220+
primitives::{Address, FixedBytes, U256},
221+
signers::local::PrivateKeySigner,
222+
sol_types::SolStruct,
223+
};
218224
use thegraph_core::attestation::eip712_domain;
219225

220226
use crate::{

crates/monitor/src/allocations.rs

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

4-
use crate::client::SubgraphClient;
5-
use alloy::{primitives::Address, primitives::TxHash};
6-
use indexer_allocation::Allocation;
7-
use indexer_query::allocations_query::{self, AllocationsQuery};
8-
use indexer_watcher::new_watcher;
94
use std::{
105
collections::HashMap,
116
time::{Duration, SystemTime, UNIX_EPOCH},
127
};
8+
9+
use alloy::primitives::{Address, TxHash};
10+
use indexer_allocation::Allocation;
11+
use indexer_query::allocations_query::{self, AllocationsQuery};
12+
use indexer_watcher::new_watcher;
1313
use tokio::sync::watch::Receiver;
1414

15+
use crate::client::SubgraphClient;
16+
1517
/// Receiver of Map between allocation id and allocation struct
1618
pub type AllocationWatcher = Receiver<HashMap<Address, Allocation>>;
1719

@@ -92,9 +94,8 @@ mod test {
9294
"https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-arbitrum";
9395
use std::str::FromStr;
9496

95-
use crate::client::{DeploymentDetails, SubgraphClient};
96-
9797
use super::*;
98+
use crate::client::{DeploymentDetails, SubgraphClient};
9899

99100
async fn network_subgraph_client() -> &'static SubgraphClient {
100101
Box::leak(Box::new(

crates/monitor/src/attestation.rs

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

4+
use std::{
5+
collections::HashMap,
6+
sync::{Arc, Mutex},
7+
};
8+
49
use bip39::Mnemonic;
510
use indexer_allocation::Allocation;
611
use indexer_attestation::AttestationSigner;
712
use indexer_watcher::join_and_map_watcher;
8-
use std::sync::Arc;
9-
use std::{collections::HashMap, sync::Mutex};
1013
use thegraph_core::{Address, ChainId};
1114
use tokio::sync::watch::Receiver;
1215
use tracing::warn;
@@ -78,9 +81,8 @@ fn modify_sigers(
7881

7982
#[cfg(test)]
8083
mod tests {
81-
use tokio::sync::watch;
82-
8384
use test_assets::{DISPUTE_MANAGER_ADDRESS, INDEXER_ALLOCATIONS, INDEXER_MNEMONIC};
85+
use tokio::sync::watch;
8486

8587
use super::*;
8688

crates/monitor/src/client/monitor.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ use indexer_query::{
88
deployment_status_query::{self, Health},
99
DeploymentStatusQuery,
1010
};
11+
use indexer_watcher::new_watcher;
1112
use reqwest::Url;
1213
use serde::Deserialize;
1314
use thegraph_core::DeploymentId;
1415
use tokio::sync::watch::Receiver;
1516

16-
use indexer_watcher::new_watcher;
17-
1817
#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
1918
pub struct DeploymentStatus {
2019
pub synced: bool,
@@ -66,8 +65,10 @@ mod tests {
6665
use std::str::FromStr;
6766

6867
use serde_json::json;
69-
use wiremock::matchers::{method, path};
70-
use wiremock::{Mock, MockServer, ResponseTemplate};
68+
use wiremock::{
69+
matchers::{method, path},
70+
Mock, MockServer, ResponseTemplate,
71+
};
7172

7273
use super::*;
7374

crates/monitor/src/client/subgraph_client.rs

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

4-
use super::monitor::{monitor_deployment_status, DeploymentStatus};
54
use anyhow::anyhow;
65
use axum::body::Bytes;
76
use graphql_client::GraphQLQuery;
@@ -10,6 +9,8 @@ use thegraph_core::DeploymentId;
109
use tokio::sync::watch::Receiver;
1110
use tracing::warn;
1211

12+
use super::monitor::{monitor_deployment_status, DeploymentStatus};
13+
1314
pub type ResponseResult<T> = Result<T, anyhow::Error>;
1415

1516
#[derive(Debug, Clone)]
@@ -253,8 +254,10 @@ mod test {
253254

254255
use indexer_query::{current_epoch, user_query, CurrentEpoch, UserQuery};
255256
use serde_json::json;
256-
use wiremock::matchers::{method, path};
257-
use wiremock::{Mock, MockServer, ResponseTemplate};
257+
use wiremock::{
258+
matchers::{method, path},
259+
Mock, MockServer, ResponseTemplate,
260+
};
258261

259262
use super::*;
260263

crates/monitor/src/deployment_to_allocation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
use std::collections::HashMap;
5-
use thegraph_core::{Address, DeploymentId};
6-
use tokio::sync::watch::Receiver;
75

86
use indexer_watcher::map_watcher;
7+
use thegraph_core::{Address, DeploymentId};
8+
use tokio::sync::watch::Receiver;
99

1010
use crate::AllocationWatcher;
1111

crates/monitor/src/dispute_manager.rs

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

4-
use crate::client::SubgraphClient;
4+
use std::time::Duration;
5+
56
use alloy::primitives::Address;
67
use anyhow::Error;
78
use indexer_query::dispute_manager::{self, DisputeManager};
89
use indexer_watcher::new_watcher;
9-
use std::time::Duration;
1010
use tokio::sync::watch::Receiver;
1111

12+
use crate::client::SubgraphClient;
13+
1214
/// Watcher for Dispute Manager Address
1315
pub type DisputeManagerWatcher = Receiver<Address>;
1416

@@ -39,9 +41,8 @@ mod test {
3941
Mock, MockServer, ResponseTemplate,
4042
};
4143

42-
use crate::{client::DeploymentDetails, client::SubgraphClient};
43-
4444
use super::*;
45+
use crate::client::{DeploymentDetails, SubgraphClient};
4546

4647
async fn setup_mock_network_subgraph() -> (&'static SubgraphClient, MockServer) {
4748
// Set up a mock network subgraph

crates/monitor/src/escrow_accounts.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,13 @@ mod tests {
171171
ESCROW_ACCOUNTS_SIGNERS_TO_SENDERS,
172172
};
173173
use test_log::test;
174-
use wiremock::matchers::{method, path};
175-
use wiremock::{Mock, MockServer, ResponseTemplate};
176-
177-
use crate::client::DeploymentDetails;
174+
use wiremock::{
175+
matchers::{method, path},
176+
Mock, MockServer, ResponseTemplate,
177+
};
178178

179179
use super::*;
180+
use crate::client::DeploymentDetails;
180181

181182
#[test]
182183
fn test_new_escrow_accounts() {

0 commit comments

Comments
 (0)