Skip to content

Commit

Permalink
chore: sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
k1rill-fedoseev committed Dec 20, 2023
1 parent 05be7fd commit 970ba2e
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 62 deletions.
22 changes: 10 additions & 12 deletions user-ops-indexer/user-ops-indexer-logic/src/indexer/v06/indexer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
use std::{future, ops::Div, time::Duration};

use crate::{
indexer::v06::constants::{
matches_entrypoint_event, parse_event, BeforeExecutionFilter, DepositedFilter,
HandleAggregatedOpsCall, HandleOpsCall, IEntrypointV06Calls, UserOperation,
UserOperationEventFilter, UserOperationRevertReasonFilter, ENTRYPOINT_V06,
},
repository,
types::user_op::{SponsorType, UserOp},
};
use anyhow::{anyhow, bail};
use ethers::prelude::{BigEndianHash, EthEvent, Middleware, Provider, PubsubClient};
use ethers_core::{
Expand All @@ -9,18 +16,9 @@ use ethers_core::{
use futures::{stream, stream::BoxStream, StreamExt};
use keccak_hash::H256;
use sea_orm::DatabaseConnection;
use std::{future, ops::Div, time::Duration};
use tokio::time::sleep;

use crate::{
indexer::v06::constants::{
matches_entrypoint_event, parse_event, BeforeExecutionFilter, DepositedFilter,
HandleAggregatedOpsCall, HandleOpsCall, IEntrypointV06Calls, UserOperation,
UserOperationEventFilter, UserOperationRevertReasonFilter, ENTRYPOINT_V06,
},
repository,
types::user_op::{SponsorType, UserOp},
};

pub struct RawUserOperation {
pub user_op: UserOperation,

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::types::account::Account;
use ethers::prelude::Address;
use sea_orm::{prelude::DateTime, ConnectionTrait, DatabaseConnection, FromQueryResult, Statement};

use crate::types::account::Account;

#[derive(FromQueryResult)]
pub struct AccountDB {
pub address: Vec<u8>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::types::bundle::Bundle;
use ethers::prelude::{Address, H256};
use sea_orm::{prelude::DateTime, ConnectionTrait, DatabaseConnection, FromQueryResult, Statement};

use crate::types::bundle::Bundle;

#[derive(FromQueryResult)]
pub struct BundleDB {
pub transaction_hash: Vec<u8>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::types::bundler::Bundler;
use ethers::prelude::Address;
use sea_orm::{ConnectionTrait, DatabaseConnection, FromQueryResult, Statement};

use crate::types::bundler::Bundler;

#[derive(FromQueryResult, Clone)]
pub struct BundlerDB {
pub bundler: Vec<u8>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::{repository::user_op::user_ops_blocks_rel, types::factory::Factory};
use entity::user_operations::{Column, Entity};
use ethers::prelude::Address;
use sea_orm::{
prelude::Expr, sea_query::IntoCondition, ColumnTrait, DatabaseConnection, EntityTrait,
FromQueryResult, IntoSimpleExpr, JoinType, QueryFilter, QueryOrder, QuerySelect,
};

use entity::user_operations::{Column, Entity};

use crate::{repository::user_op::user_ops_blocks_rel, types::factory::Factory};

#[derive(FromQueryResult, Clone)]
pub struct FactoryDB {
pub factory: Vec<u8>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::{repository::user_op::user_ops_blocks_rel, types::paymaster::Paymaster};
use entity::user_operations::{Column, Entity};
use ethers::prelude::Address;
use sea_orm::{
prelude::Expr, sea_query::IntoCondition, ColumnTrait, DatabaseConnection, EntityTrait,
FromQueryResult, IntoSimpleExpr, JoinType, QueryFilter, QueryOrder, QuerySelect,
};

use entity::user_operations::{Column, Entity};

use crate::{repository::user_op::user_ops_blocks_rel, types::paymaster::Paymaster};

#[derive(FromQueryResult, Clone)]
pub struct PaymasterDB {
pub paymaster: Vec<u8>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::types::user_op::{ListUserOp, UserOp};
use blockscout_db::entity::blocks;
use entity::user_operations::{ActiveModel, Column, Entity, Model};
use ethers::prelude::{Address, H256};
use sea_orm::{
prelude::DateTime,
Expand All @@ -8,10 +10,6 @@ use sea_orm::{
QueryTrait, RelationDef, Statement,
};

use entity::user_operations::{ActiveModel, Column, Entity, Model};

use crate::types::user_op::{ListUserOp, UserOp};

#[derive(FromQueryResult)]
struct TxHash {
transaction_hash: Vec<u8>,
Expand Down
6 changes: 2 additions & 4 deletions user-ops-indexer/user-ops-indexer-logic/src/types/account.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::repository::account::AccountDB;
pub use entity::sea_orm_active_enums::SponsorType;
use ethers::prelude::{Address, H256};
use ethers_core::{abi::AbiEncode, utils::to_checksum};

pub use entity::sea_orm_active_enums::SponsorType;

use crate::repository::account::AccountDB;

#[derive(Clone, Debug, PartialEq)]
pub struct Account {
pub address: Address,
Expand Down
6 changes: 2 additions & 4 deletions user-ops-indexer/user-ops-indexer-logic/src/types/bundle.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::repository::bundle::BundleDB;
pub use entity::sea_orm_active_enums::SponsorType;
use ethers::prelude::{Address, H256};
use ethers_core::{abi::AbiEncode, utils::to_checksum};

pub use entity::sea_orm_active_enums::SponsorType;

use crate::repository::bundle::BundleDB;

#[derive(Clone, Debug, PartialEq)]
pub struct Bundle {
pub transaction_hash: H256,
Expand Down
6 changes: 2 additions & 4 deletions user-ops-indexer/user-ops-indexer-logic/src/types/bundler.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::repository::bundler::BundlerDB;
pub use entity::sea_orm_active_enums::SponsorType;
use ethers::prelude::Address;
use ethers_core::utils::to_checksum;

pub use entity::sea_orm_active_enums::SponsorType;

use crate::repository::bundler::BundlerDB;

#[derive(Clone, Debug, PartialEq)]
pub struct Bundler {
pub bundler: Address,
Expand Down
6 changes: 2 additions & 4 deletions user-ops-indexer/user-ops-indexer-logic/src/types/factory.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::repository::factory::FactoryDB;
pub use entity::sea_orm_active_enums::SponsorType;
use ethers::prelude::Address;
use ethers_core::utils::to_checksum;

pub use entity::sea_orm_active_enums::SponsorType;

use crate::repository::factory::FactoryDB;

#[derive(Clone, Debug, PartialEq)]
pub struct Factory {
pub factory: Address,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::repository::paymaster::PaymasterDB;
pub use entity::sea_orm_active_enums::SponsorType;
use ethers::prelude::Address;
use ethers_core::utils::to_checksum;

pub use entity::sea_orm_active_enums::SponsorType;

use crate::repository::paymaster::PaymasterDB;

#[derive(Clone, Debug, PartialEq)]
pub struct Paymaster {
pub paymaster: Address,
Expand Down
8 changes: 3 additions & 5 deletions user-ops-indexer/user-ops-indexer-logic/src/types/user_op.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::{repository::user_op::ListUserOpDB, types::common::u256_to_decimal};
pub use entity::sea_orm_active_enums::SponsorType;
use entity::user_operations::Model;
use ethers::prelude::{Address, Bytes, H256, U256};
use ethers_core::{abi::AbiEncode, utils::to_checksum};
use num_traits::cast::ToPrimitive;
use sea_orm::{prelude::BigDecimal, ActiveEnum};

pub use entity::sea_orm_active_enums::SponsorType;
use entity::user_operations::Model;

use crate::{repository::user_op::ListUserOpDB, types::common::u256_to_decimal};

#[derive(Clone, Debug, PartialEq)]
pub struct UserOp {
pub hash: H256,
Expand Down
1 change: 0 additions & 1 deletion user-ops-indexer/user-ops-indexer-server/src/indexer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::settings::Settings;

use ethers::prelude::{Provider, Ws};
use sea_orm::DatabaseConnection;

Expand Down
1 change: 0 additions & 1 deletion user-ops-indexer/user-ops-indexer-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::{
settings::Settings,
};
use blockscout_service_launcher::{launcher, launcher::LaunchSettings};

use sea_orm::DatabaseConnection;
use std::sync::Arc;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use std::str::FromStr;

use crate::{proto::user_ops_service_server::UserOpsService as UserOps, settings::ApiSettings};
use ethers::{
abi::{AbiEncode, Address},
prelude::H256,
utils::to_checksum,
};
use sea_orm::DatabaseConnection;
use std::str::FromStr;
use tonic::{Request, Response, Status};

use user_ops_indexer_logic::repository;
use user_ops_indexer_proto::blockscout::user_ops_indexer::v1::{
Account, Bundler, Factory, GetAccountRequest, GetBundlerRequest, GetFactoryRequest,
Expand All @@ -17,8 +16,6 @@ use user_ops_indexer_proto::blockscout::user_ops_indexer::v1::{
ListUserOpsRequest, ListUserOpsResponse, Paymaster, UserOp,
};

use crate::{proto::user_ops_service_server::UserOpsService as UserOps, settings::ApiSettings};

const DEFAULT_PAGE_SIZE: u32 = 10;

pub struct UserOpsService {
Expand Down

0 comments on commit 970ba2e

Please sign in to comment.