diff --git a/README.md b/README.md index 48a8be5..6f3fc3d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ use crate::states::Nft; pub struct TransferHandler; -#[chaindexing::augmenting_std::async_trait::async_trait] +#[chaindexing::augmenting_std::async_trait] impl EventHandler for TransferHandler { fn abi(&self) -> &'static str { "event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)" diff --git a/chaindexing-tests/src/factory/handlers.rs b/chaindexing-tests/src/factory/handlers.rs index c02ff65..63d9875 100644 --- a/chaindexing-tests/src/factory/handlers.rs +++ b/chaindexing-tests/src/factory/handlers.rs @@ -5,7 +5,7 @@ pub struct NftState; pub struct TransferTestHandler; -#[chaindexing::augmenting_std::async_trait::async_trait] +#[chaindexing::augmenting_std::async_trait] impl EventHandler for TransferTestHandler { fn abi(&self) -> &'static str { "event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)" @@ -15,7 +15,7 @@ impl EventHandler for TransferTestHandler { pub struct ApprovalForAllTestHandler; -#[chaindexing::augmenting_std::async_trait::async_trait] +#[chaindexing::augmenting_std::async_trait] impl EventHandler for ApprovalForAllTestHandler { fn abi(&self) -> &'static str { "event ApprovalForAll(address indexed owner, address indexed operator, bool approved)" diff --git a/chaindexing-tests/src/factory/providers.rs b/chaindexing-tests/src/factory/providers.rs index 09f9005..698ea06 100644 --- a/chaindexing-tests/src/factory/providers.rs +++ b/chaindexing-tests/src/factory/providers.rs @@ -7,7 +7,7 @@ use rand::seq::SliceRandom; pub fn empty_provider() -> impl IngesterProvider { #[derive(Clone)] struct Provider; - #[chaindexing::augmenting_std::async_trait::async_trait] + #[chaindexing::augmenting_std::async_trait] impl IngesterProvider for Provider { async fn get_block_number(&self) -> Result { Ok(U64::from(0)) @@ -79,7 +79,7 @@ macro_rules! provider_with_logs { struct Provider { contract_address: String, } - #[chaindexing::augmenting_std::async_trait::async_trait] + #[chaindexing::augmenting_std::async_trait] impl IngesterProvider for Provider { async fn get_block_number(&self) -> Result { Ok(U64::from($current_block_number)) @@ -112,7 +112,7 @@ macro_rules! provider_with_filter_stubber { #[derive(Clone)] struct Provider; - #[chaindexing::augmenting_std::async_trait::async_trait] + #[chaindexing::augmenting_std::async_trait] impl IngesterProvider for Provider { async fn get_block_number(&self) -> Result { Ok(U64::from(3)) @@ -147,7 +147,7 @@ macro_rules! provider_with_empty_logs { #[derive(Clone)] struct Provider; - #[chaindexing::augmenting_std::async_trait::async_trait] + #[chaindexing::augmenting_std::async_trait] impl IngesterProvider for Provider { async fn get_block_number(&self) -> Result { Ok(U64::from(3)) diff --git a/chaindexing/src/augmenting_std.rs b/chaindexing/src/augmenting_std.rs index c290931..c5d28ce 100644 --- a/chaindexing/src/augmenting_std.rs +++ b/chaindexing/src/augmenting_std.rs @@ -1,5 +1,5 @@ #[doc(hidden)] -pub use async_trait; +pub use async_trait::async_trait; #[doc(hidden)] pub use serde; diff --git a/chaindexing/src/handlers/pure_handler.rs b/chaindexing/src/handlers/pure_handler.rs index c22beb8..693e6c8 100644 --- a/chaindexing/src/handlers/pure_handler.rs +++ b/chaindexing/src/handlers/pure_handler.rs @@ -10,7 +10,7 @@ use super::handler_context::HandlerContext; /// Pure handlers do not contain any side effects. They are simple reducers /// that derive or index states deterministically. -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait PureHandler: Send + Sync { /// The human-readable ABI of the event being handled. /// For example, Uniswap's PoolCreated event's abi is: diff --git a/chaindexing/src/handlers/side_effect_handler.rs b/chaindexing/src/handlers/side_effect_handler.rs index d27311c..714f6c6 100644 --- a/chaindexing/src/handlers/side_effect_handler.rs +++ b/chaindexing/src/handlers/side_effect_handler.rs @@ -14,7 +14,7 @@ use super::handler_context::HandlerContext; /// that the side-effect handlers are called once immutably regardless of resets. /// However, one can dangerously reset including side effects with the `reset_including_side_effects` /// exposed in the Config API. -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait SideEffectHandler: Send + Sync { type SharedState: Send + Sync + Clone + Debug; diff --git a/chaindexing/src/ingester/provider.rs b/chaindexing/src/ingester/provider.rs index 3b28bf6..9a93931 100644 --- a/chaindexing/src/ingester/provider.rs +++ b/chaindexing/src/ingester/provider.rs @@ -13,7 +13,7 @@ use super::filters::Filter; pub type ProviderError = EthersProviderError; -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait Provider: Clone + Sync + Send { async fn get_block_number(&self) -> Result; async fn get_logs(&self, filter: &EthersFilter) -> Result, ProviderError>; @@ -50,7 +50,7 @@ pub trait Provider: Clone + Sync + Send { } } -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] impl Provider for EthersProvider { async fn get_block_number(&self) -> Result { Middleware::get_block_number(&self).await diff --git a/chaindexing/src/lib.rs b/chaindexing/src/lib.rs index bf86081..ac2fcb2 100644 --- a/chaindexing/src/lib.rs +++ b/chaindexing/src/lib.rs @@ -210,7 +210,7 @@ fn get_tasks_runner( struct ChaindexingNodeTasksRunner<'a, S: Send + Sync + Clone + Debug + 'static> { config: &'a Config, } - #[crate::augmenting_std::async_trait::async_trait] + #[crate::augmenting_std::async_trait] impl<'a, S: Send + Sync + Clone + Debug + 'static> NodeTasksRunner for ChaindexingNodeTasksRunner<'a, S> { diff --git a/chaindexing/src/nodes/node_tasks_runner.rs b/chaindexing/src/nodes/node_tasks_runner.rs index bedc433..0ef3c01 100644 --- a/chaindexing/src/nodes/node_tasks_runner.rs +++ b/chaindexing/src/nodes/node_tasks_runner.rs @@ -1,6 +1,6 @@ use super::node_task::NodeTask; -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait NodeTasksRunner { async fn run(&self) -> Vec; } diff --git a/chaindexing/src/repos/postgres_repo.rs b/chaindexing/src/repos/postgres_repo.rs index 97e9c22..afbfd21 100644 --- a/chaindexing/src/repos/postgres_repo.rs +++ b/chaindexing/src/repos/postgres_repo.rs @@ -54,7 +54,7 @@ impl PostgresRepo { } } -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] impl Repo for PostgresRepo { type Conn<'a> = PgPooledConn<'a>; type Pool = bb8::Pool>; diff --git a/chaindexing/src/repos/postgres_repo/raw_queries.rs b/chaindexing/src/repos/postgres_repo/raw_queries.rs index 227fa6f..01df52c 100644 --- a/chaindexing/src/repos/postgres_repo/raw_queries.rs +++ b/chaindexing/src/repos/postgres_repo/raw_queries.rs @@ -10,7 +10,7 @@ use serde::de::DeserializeOwned; pub type PostgresRepoClient = Client; pub type PostgresRepoTxnClient<'a> = Transaction<'a>; -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] impl HasRawQueryClient for PostgresRepo { type RawQueryClient = Client; type RawQueryTxnClient<'a> = Transaction<'a>; @@ -29,7 +29,7 @@ impl HasRawQueryClient for PostgresRepo { } } -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] impl ExecutesWithRawQuery for PostgresRepo { async fn execute(client: &Self::RawQueryClient, query: &str) { client.execute(query, &[] as &[&(dyn ToSql + Sync)]).await.unwrap(); @@ -206,7 +206,7 @@ impl ExecutesWithRawQuery for PostgresRepo { } } -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] impl LoadsDataWithRawQuery for PostgresRepo { async fn create_and_load_new_node(client: &Self::RawQueryClient) -> Node { Self::load_data( diff --git a/chaindexing/src/repos/repo.rs b/chaindexing/src/repos/repo.rs index 20c1146..c3d7661 100644 --- a/chaindexing/src/repos/repo.rs +++ b/chaindexing/src/repos/repo.rs @@ -21,7 +21,7 @@ pub enum RepoError { Unknown(String), } -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait Repo: Sync + Send + Migratable + ExecutesWithRawQuery + LoadsDataWithRawQuery + Clone + Debug { @@ -69,7 +69,7 @@ pub trait Repo: async fn keep_node_active<'a>(conn: &mut Self::Conn<'a>, node: &Node); } -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait HasRawQueryClient { type RawQueryClient: Send + Sync; type RawQueryTxnClient<'a>: Send + Sync; @@ -80,7 +80,7 @@ pub trait HasRawQueryClient { ) -> Self::RawQueryTxnClient<'a>; } -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait ExecutesWithRawQuery: HasRawQueryClient { async fn execute(client: &Self::RawQueryClient, query: &str); async fn execute_in_txn<'a>(client: &Self::RawQueryTxnClient<'a>, query: &str); @@ -127,7 +127,7 @@ pub trait ExecutesWithRawQuery: HasRawQueryClient { async fn prune_root_states(client: &Self::RawQueryClient, retain_size: u64); } -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait LoadsDataWithRawQuery: HasRawQueryClient { async fn create_and_load_new_node(client: &Self::RawQueryClient) -> Node; async fn load_last_root_state(client: &Self::RawQueryClient) -> Option; @@ -196,7 +196,7 @@ pub trait RepoMigrations: Migratable { } } -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait Migratable: ExecutesWithRawQuery + Sync + Send { async fn migrate(client: &Self::RawQueryClient, migrations: Vec + Send + Sync>) where diff --git a/chaindexing/src/states/chain_state.rs b/chaindexing/src/states/chain_state.rs index 1e7877e..441b102 100644 --- a/chaindexing/src/states/chain_state.rs +++ b/chaindexing/src/states/chain_state.rs @@ -14,7 +14,7 @@ use serde::de::DeserializeOwned; use serde::Serialize; /// States derived from different contracts within a chain -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait ChainState: DeserializeOwned + Serialize + Clone + Debug + Sync + Send + 'static { /// Table of the state as specified in StateMigrations fn table_name() -> &'static str; diff --git a/chaindexing/src/states/contract_state.rs b/chaindexing/src/states/contract_state.rs index ede7a7a..f7279c5 100644 --- a/chaindexing/src/states/contract_state.rs +++ b/chaindexing/src/states/contract_state.rs @@ -14,7 +14,7 @@ use serde::de::DeserializeOwned; use serde::Serialize; /// States derived from a contract -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait ContractState: DeserializeOwned + Serialize + Clone + Debug + Sync + Send + 'static { diff --git a/chaindexing/src/states/multi_chain_state.rs b/chaindexing/src/states/multi_chain_state.rs index 3aaa3bd..ca85f77 100644 --- a/chaindexing/src/states/multi_chain_state.rs +++ b/chaindexing/src/states/multi_chain_state.rs @@ -14,7 +14,7 @@ use serde::Serialize; /// States derived from different contracts across different chains /// N/B: Indexing MultiChainStates must be Order-Agnostic -#[crate::augmenting_std::async_trait::async_trait] +#[crate::augmenting_std::async_trait] pub trait MultiChainState: DeserializeOwned + Serialize + Clone + Debug + Sync + Send + 'static {