Skip to content

Commit

Permalink
provider: facilitate providers import (#1341)
Browse files Browse the repository at this point in the history
* provider: facilitate provider import

* fmt
  • Loading branch information
tcoratger authored Aug 21, 2024
1 parent e1a7c0a commit 93d7e9f
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/providers/eth_provider/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use super::{
error::EthApiError,
};
use crate::providers::eth_provider::{
blocks::BlockProvider,
database::{
filter::{self},
FindOpts,
},
provider::{EthDataProvider, EthProviderResult},
BlockProvider,
};
use async_trait::async_trait;
use auto_impl::auto_impl;
Expand Down
9 changes: 9 additions & 0 deletions src/providers/eth_provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ pub mod state;
pub mod transactions;
pub mod tx_pool;
pub mod utils;

pub use blocks::*;
pub use chain::*;
pub use gas::*;
pub use logs::*;
pub use receipts::*;
pub use state::*;
pub use transactions::*;
pub use tx_pool::*;
3 changes: 1 addition & 2 deletions src/providers/eth_provider/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ use crate::{
felt::Felt252Wrapper,
},
providers::eth_provider::{
blocks::BlockProvider, gas::GasProvider, logs::LogProvider, receipts::ReceiptProvider, state::StateProvider,
transactions::TransactionProvider, tx_pool::TxPoolProvider,
BlockProvider, GasProvider, LogProvider, ReceiptProvider, StateProvider, TransactionProvider, TxPoolProvider,
},
};
use async_trait::async_trait;
Expand Down
3 changes: 1 addition & 2 deletions src/providers/eth_provider/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ use crate::{
into_via_wrapper,
models::felt::Felt252Wrapper,
providers::eth_provider::{
blocks::BlockProvider,
chain::ChainProvider,
provider::{EthDataProvider, EthProviderResult},
BlockProvider, ChainProvider,
},
};
use async_trait::async_trait;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/eth_provider/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ use crate::{
into_via_wrapper,
models::{felt::Felt252Wrapper, transaction::validate_transaction},
providers::eth_provider::{
chain::ChainProvider,
database::{
ethereum::EthereumTransactionStore,
filter::{self, format_hex},
},
provider::{EthDataProvider, EthProviderResult},
ChainProvider,
},
};
use alloy_rlp::Decodable;
Expand Down
3 changes: 1 addition & 2 deletions src/test_utils/eoa.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::{
models::felt::Felt252Wrapper,
providers::eth_provider::{
chain::ChainProvider, provider::EthDataProvider, starknet::kakarot_core::starknet_address,
transactions::TransactionProvider,
provider::EthDataProvider, starknet::kakarot_core::starknet_address, ChainProvider, TransactionProvider,
},
test_utils::{
evm_contract::{EvmContract, KakarotEvmContract, TransactionInfo, TxCommonInfo, TxFeeMarketInfo},
Expand Down
4 changes: 2 additions & 2 deletions src/test_utils/mock_provider.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::providers::eth_provider::{
blocks::BlockProvider, chain::ChainProvider, gas::GasProvider, logs::LogProvider, provider::EthProviderResult,
receipts::ReceiptProvider, state::StateProvider, transactions::TransactionProvider, tx_pool::TxPoolProvider,
provider::EthProviderResult, BlockProvider, ChainProvider, GasProvider, LogProvider, ReceiptProvider,
StateProvider, TransactionProvider, TxPoolProvider,
};
use async_trait::async_trait;
use mockall::mock;
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/debug_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![cfg(feature = "testing")]
use alloy_rlp::Encodable;
use kakarot_rpc::{
providers::eth_provider::{blocks::BlockProvider, receipts::ReceiptProvider, transactions::TransactionProvider},
providers::eth_provider::{BlockProvider, ReceiptProvider, TransactionProvider},
test_utils::{
fixtures::{katana, setup},
katana::Katana,
Expand Down
8 changes: 1 addition & 7 deletions tests/tests/eth_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ use alloy_sol_types::{sol, SolCall};
use kakarot_rpc::{
models::felt::Felt252Wrapper,
providers::eth_provider::{
blocks::BlockProvider,
chain::ChainProvider,
constant::{MAX_LOGS, STARKNET_MODULUS},
database::{ethereum::EthereumTransactionStore, types::transaction::StoredPendingTransaction},
gas::GasProvider,
logs::LogProvider,
provider::EthereumProvider,
receipts::ReceiptProvider,
state::StateProvider,
transactions::TransactionProvider,
BlockProvider, ChainProvider, GasProvider, LogProvider, ReceiptProvider, StateProvider, TransactionProvider,
},
test_utils::{
eoa::Eoa,
Expand Down
3 changes: 1 addition & 2 deletions tests/tests/kakarot_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#![cfg(feature = "testing")]
use kakarot_rpc::{
providers::eth_provider::{
chain::ChainProvider, constant::Constant, database::types::transaction::StoredPendingTransaction,
transactions::TransactionProvider,
constant::Constant, database::types::transaction::StoredPendingTransaction, ChainProvider, TransactionProvider,
},
test_utils::{
eoa::Eoa,
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/trace_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use alloy_dyn_abi::DynSolValue;
use alloy_sol_types::{sol, SolCall};
use kakarot_rpc::{
providers::eth_provider::chain::ChainProvider,
providers::eth_provider::ChainProvider,
test_utils::{
eoa::Eoa,
evm_contract::{EvmContract, KakarotEvmContract, TransactionInfo, TxCommonInfo, TxFeeMarketInfo},
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![cfg(feature = "testing")]
use alloy_dyn_abi::DynSolValue;
use kakarot_rpc::{
providers::eth_provider::{blocks::BlockProvider, chain::ChainProvider},
providers::eth_provider::{BlockProvider, ChainProvider},
test_utils::{
eoa::Eoa,
evm_contract::{EvmContract, KakarotEvmContract, TransactionInfo, TxCommonInfo, TxFeeMarketInfo},
Expand Down

0 comments on commit 93d7e9f

Please sign in to comment.