From e201e854862ba0ecd29f703bff4c305fc7d2ce22 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 17 Mar 2021 19:36:46 +0100 Subject: [PATCH] test: check that ethevent proc macro attributes compile --- ethers-contract/tests/common/derive.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ethers-contract/tests/common/derive.rs b/ethers-contract/tests/common/derive.rs index 2757178f..e52e98f0 100644 --- a/ethers-contract/tests/common/derive.rs +++ b/ethers-contract/tests/common/derive.rs @@ -195,3 +195,21 @@ fn can_set_eth_abi_attribute() { ValueChangedEvent2::abi_signature() ); } + +#[test] +fn can_derive_indexed_and_anonymous_attribute() { + #[derive(Debug, PartialEq, EthEvent)] + #[ethevent(anonymous)] + struct ValueChangedEvent { + old_author: Address, + #[ethevent(indexed, name = "newAuthor")] + new_author: Address, + old_value: String, + new_value: String, + } + + assert_eq!( + "ValueChangedEvent(address,address,string,string) anonymous", + ValueChangedEvent::abi_signature() + ); +}