diff --git a/ethers-contract/ethers-contract-abigen/src/contract/events.rs b/ethers-contract/ethers-contract-abigen/src/contract/events.rs index eea9d52b..dadaed3f 100644 --- a/ethers-contract/ethers-contract-abigen/src/contract/events.rs +++ b/ethers-contract/ethers-contract-abigen/src/contract/events.rs @@ -384,10 +384,8 @@ mod tests { let cx = test_context(); assert_quote!(cx.expand_filter(&event), { #[doc = "Gets the contract's `Transfer` event"] - pub fn transfer_filter(&self) -> Event { - self.0 - .event("Transfer") - .expect("event not found (this should never happen)") + pub fn transfer_filter(&self) -> ethers_contract::builders::Event { + self.0.event() } }); } @@ -419,7 +417,7 @@ mod tests { assert_quote!(definition, { struct FooFilter { pub a: bool, - pub p1: Address, + pub p1: ethers_core::types::Address, } }); } @@ -446,10 +444,10 @@ mod tests { let cx = test_context(); let params = cx.expand_params(&event).unwrap(); let name = expand_struct_name(&event); - let definition = expand_data_tuple(name, ¶ms); + let definition = expand_data_tuple(&name, ¶ms); assert_quote!(definition, { - struct FooFilter(pub bool, pub Address); + struct FooFilter(pub bool, pub ethers_core::types::Address); }); } diff --git a/ethers-contract/ethers-contract-abigen/src/contract/methods.rs b/ethers-contract/ethers-contract-abigen/src/contract/methods.rs index 141c2b3b..a33329cd 100644 --- a/ethers-contract/ethers-contract-abigen/src/contract/methods.rs +++ b/ethers-contract/ethers-contract-abigen/src/contract/methods.rs @@ -179,7 +179,7 @@ mod tests { ], ) .unwrap(), - { , a: bool, b: Address }, + { , a: bool, b: ethers_core::types::Address }, ); } @@ -214,7 +214,7 @@ mod tests { }, ],) .unwrap(), - { (bool, Address) }, + { (bool, ethers_core::types::Address) }, ); } } diff --git a/ethers-contract/ethers-contract-derive/src/lib.rs b/ethers-contract/ethers-contract-derive/src/lib.rs index 6f9e5f2c..e2a64a91 100644 --- a/ethers-contract/ethers-contract-derive/src/lib.rs +++ b/ethers-contract/ethers-contract-derive/src/lib.rs @@ -96,7 +96,7 @@ pub fn abigen(input: TokenStream) -> TokenStream { /// - `name`: override the name of an indexed event input, default is the rust field name /// /// # Example -/// ```no_run +/// ```ignore /// # use ethers_core::types::Address; /// /// #[derive(Debug, EthAbiType)] diff --git a/ethers-contract/tests/common/mod.rs b/ethers-contract/tests/common/mod.rs index 70f12c1c..ea1ffca9 100644 --- a/ethers-contract/tests/common/mod.rs +++ b/ethers-contract/tests/common/mod.rs @@ -11,11 +11,13 @@ use ethers_providers::{Http, Middleware, Provider}; use ethers_signers::LocalWallet; use std::{convert::TryFrom, sync::Arc, time::Duration}; -// Note: The `EthAbiType` derive macro implements the necessary conversion between `Tokens` and +// Note: The `EthEvent` derive macro implements the necessary conversion between `Tokens` and // the struct #[derive(Clone, Debug, EthEvent)] pub struct ValueChanged { + #[ethevent(indexed)] pub old_author: Address, + #[ethevent(indexed)] pub new_author: Address, pub old_value: String, pub new_value: String, diff --git a/ethers-contract/tests/decode_logs2.rs b/ethers-contract/tests/decode_logs2.rs deleted file mode 100644 index 83381972..00000000 --- a/ethers-contract/tests/decode_logs2.rs +++ /dev/null @@ -1,9 +0,0 @@ -use ethers_contract::{abigen, EthEvent}; -// use ethers_core::abi::Tokenizable; -// -abigen!(DsProxyFactory, - "ethers-middleware/contracts/DsProxyFactory.json", - methods { - build(address) as build_with_owner; - } -); diff --git a/ethers-middleware/src/transformer/ds_proxy/factory.rs b/ethers-middleware/src/transformer/ds_proxy/factory.rs index 0e5b23e6..5c1ce8a4 100644 --- a/ethers-middleware/src/transformer/ds_proxy/factory.rs +++ b/ethers-middleware/src/transformer/ds_proxy/factory.rs @@ -17,7 +17,7 @@ pub static ADDRESS_BOOK: Lazy> = Lazy::new(|| { /// /// Generated with -/// ```no_run +/// ```ignore /// # use ethers_contract::abigen; /// abigen!(DsProxyFactory, /// "ethers-middleware/contracts/DsProxyFactory.json",