test: check that ethevent proc macro attributes compile

This commit is contained in:
Matthias Seitz 2021-03-17 19:36:46 +01:00
parent 245c57a06e
commit e201e85486
1 changed files with 18 additions and 0 deletions

View File

@ -195,3 +195,21 @@ fn can_set_eth_abi_attribute() {
ValueChangedEvent2::abi_signature() 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()
);
}