Skip to content

Commit 78ba9da

Browse files
committed
reformat imports
1 parent 7e89634 commit 78ba9da

File tree

15 files changed

+68
-63
lines changed

15 files changed

+68
-63
lines changed

apps/fortuna/src/api.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use crate::history::History;
21
use {
32
crate::{
43
chain::reader::{BlockNumber, BlockStatus, EntropyReader},
4+
history::History,
55
state::HashChainState,
66
},
77
anyhow::Result,
@@ -200,12 +200,14 @@ pub fn get_register_uri(base_uri: &str, chain_id: &str) -> Result<String> {
200200

201201
#[cfg(test)]
202202
mod test {
203-
use crate::api::ApiBlockChainState;
204-
use crate::history::History;
205203
use {
206204
crate::{
207-
api::{self, ApiState, BinaryEncoding, Blob, BlockchainState, GetRandomValueResponse},
205+
api::{
206+
self, ApiBlockChainState, ApiState, BinaryEncoding, Blob, BlockchainState,
207+
GetRandomValueResponse,
208+
},
208209
chain::reader::{mock::MockEntropyReader, BlockStatus},
210+
history::History,
209211
state::{HashChainState, PebbleHashChain},
210212
},
211213
axum::http::StatusCode,

apps/fortuna/src/api/explorer.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
use crate::api::{ChainId, RestError};
2-
use crate::history::RequestStatus;
3-
use axum::extract::{Query, State};
4-
use axum::Json;
5-
use chrono::{DateTime, Utc};
6-
use ethers::types::{Address, TxHash};
7-
use std::str::FromStr;
8-
use utoipa::IntoParams;
1+
use {
2+
crate::{
3+
api::{ChainId, RestError},
4+
history::RequestStatus,
5+
},
6+
axum::{
7+
extract::{Query, State},
8+
Json,
9+
},
10+
chrono::{DateTime, Utc},
11+
ethers::types::{Address, TxHash},
12+
std::str::FromStr,
13+
utoipa::IntoParams,
14+
};
915

1016
#[derive(Debug, serde::Serialize, serde::Deserialize, IntoParams)]
1117
#[into_params(parameter_in=Query)]

apps/fortuna/src/api/revelation.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use crate::api::ApiBlockChainState;
2-
use crate::chain::reader::BlockNumber;
31
use {
4-
crate::api::{ChainId, RequestLabel, RestError},
2+
crate::{
3+
api::{ApiBlockChainState, ChainId, RequestLabel, RestError},
4+
chain::reader::BlockNumber,
5+
},
56
anyhow::Result,
67
axum::{
78
extract::{Path, Query, State},

apps/fortuna/src/chain/ethereum.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
use crate::chain::reader::EntropyRequestInfo;
2-
use ethers::contract::LogMeta;
31
use {
42
crate::{
53
api::ChainId,
64
chain::reader::{
7-
self, BlockNumber, BlockStatus, EntropyReader, RequestedWithCallbackEvent,
5+
self, BlockNumber, BlockStatus, EntropyReader, EntropyRequestInfo,
6+
RequestedWithCallbackEvent,
87
},
98
config::EthereumConfig,
109
eth_utils::{
@@ -18,7 +17,7 @@ use {
1817
axum::async_trait,
1918
ethers::{
2019
abi::RawLog,
21-
contract::{abigen, EthLogDecode},
20+
contract::{abigen, EthLogDecode, LogMeta},
2221
core::types::Address,
2322
middleware::{gas_oracle::GasOracleMiddleware, SignerMiddleware},
2423
prelude::JsonRpcClient,

apps/fortuna/src/chain/reader.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
use ethers::prelude::LogMeta;
21
use {
32
anyhow::Result,
43
axum::async_trait,
5-
ethers::types::{Address, BlockNumber as EthersBlockNumber, U256},
4+
ethers::{
5+
prelude::LogMeta,
6+
types::{Address, BlockNumber as EthersBlockNumber, U256},
7+
},
68
};
79

810
pub type BlockNumber = u64;

apps/fortuna/src/command/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
use crate::history::History;
21
use {
32
crate::{
43
api::{self, ApiBlockChainState, BlockchainState, ChainId},
54
chain::ethereum::InstrumentedPythContract,
65
command::register_provider::CommitmentMetadata,
76
config::{Commitment, Config, EthereumConfig, ProviderConfig, RunOptions},
87
eth_utils::traced_client::RpcMetrics,
8+
history::History,
99
keeper::{self, keeper_metrics::KeeperMetrics},
1010
state::{HashChainState, PebbleHashChain},
1111
},

apps/fortuna/src/eth_utils/nonce_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
use {
55
super::legacy_tx_middleware::LegacyTxMiddleware,
66
axum::async_trait,
7-
ethers::prelude::GasOracle,
87
ethers::{
98
middleware::gas_oracle::GasOracleMiddleware,
9+
prelude::GasOracle,
1010
providers::{Middleware, MiddlewareError, PendingTransaction},
1111
types::{transaction::eip2718::TypedTransaction, *},
1212
},

apps/fortuna/src/eth_utils/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use ethabi::ethereum_types::U64;
21
use {
32
crate::eth_utils::nonce_manager::NonceManaged,
43
anyhow::{anyhow, Result},
54
backoff::ExponentialBackoff,
5+
ethabi::ethereum_types::U64,
66
ethers::{
77
contract::ContractCall,
88
middleware::Middleware,

apps/fortuna/src/history.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
use crate::api::ChainId;
2-
use anyhow::Result;
3-
use chrono::{DateTime, NaiveDateTime};
4-
use ethers::core::utils::hex::ToHex;
5-
use ethers::prelude::TxHash;
6-
use ethers::types::Address;
7-
use serde::Serialize;
8-
use sqlx::{migrate, Pool, Sqlite, SqlitePool};
9-
use std::sync::Arc;
10-
use tokio::spawn;
11-
use tokio::sync::mpsc;
12-
use utoipa::ToSchema;
1+
use {
2+
crate::api::ChainId,
3+
anyhow::Result,
4+
chrono::{DateTime, NaiveDateTime},
5+
ethers::{core::utils::hex::ToHex, prelude::TxHash, types::Address},
6+
serde::Serialize,
7+
sqlx::{migrate, Pool, Sqlite, SqlitePool},
8+
std::sync::Arc,
9+
tokio::{spawn, sync::mpsc},
10+
utoipa::ToSchema,
11+
};
1312

1413
#[derive(Clone, Debug, Serialize, ToSchema, PartialEq)]
1514
pub enum RequestEntryState {
@@ -340,9 +339,7 @@ impl History {
340339

341340
#[cfg(test)]
342341
mod test {
343-
use super::*;
344-
use chrono::Duration;
345-
use tokio::time::sleep;
342+
use {super::*, chrono::Duration, tokio::time::sleep};
346343

347344
fn get_random_request_status() -> RequestStatus {
348345
RequestStatus {

apps/fortuna/src/keeper.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
use crate::history::History;
2-
use crate::keeper::block::ProcessParams;
3-
use crate::keeper::track::track_block_timestamp_lag;
41
use {
52
crate::{
63
api::{BlockchainState, ChainId},
74
chain::ethereum::{InstrumentedPythContract, InstrumentedSignablePythContract},
85
config::EthereumConfig,
96
eth_utils::traced_client::RpcMetrics,
10-
keeper::block::{
11-
get_latest_safe_block, process_backlog, process_new_blocks, watch_blocks_wrapper,
12-
BlockRange,
7+
history::History,
8+
keeper::{
9+
block::{
10+
get_latest_safe_block, process_backlog, process_new_blocks, watch_blocks_wrapper,
11+
BlockRange, ProcessParams,
12+
},
13+
commitment::update_commitments_loop,
14+
fee::{adjust_fee_wrapper, withdraw_fees_wrapper},
15+
track::{
16+
track_accrued_pyth_fees, track_balance, track_block_timestamp_lag, track_provider,
17+
},
1318
},
14-
keeper::commitment::update_commitments_loop,
15-
keeper::fee::adjust_fee_wrapper,
16-
keeper::fee::withdraw_fees_wrapper,
17-
keeper::track::track_accrued_pyth_fees,
18-
keeper::track::track_balance,
19-
keeper::track::track_provider,
2019
},
2120
ethers::{signers::Signer, types::U256},
2221
keeper_metrics::{AccountLabel, KeeperMetrics},

0 commit comments

Comments
 (0)