-
Notifications
You must be signed in to change notification settings - Fork 791
Auto impl display for Abigen Event Structs #507
Comments
it really boils down to rules for some so essefntially
|
Maybe erring on the side of simplicity / consistency:
|
I suppose we should limit this to |
My thinking was that the I think that doing it for EthAbiType/EthEvent also makes sense, so i'd be supportive of doing that too - unless you think that it's a footgun in any way |
I think we could go for an #[derive(Debug, Clone, PartialEq, EthAbiType, EthDisplay)]
struct ValueChanged {
old_author: Address,
new_author: Address,
}
assert_eq!("0x.....,0x....", format!("{}", ValueChanged{...})); |
Is your feature request related to a problem? Please describe.
Right now, printing events in a nice human readable way requires matching on each event variant and then formatting the output. This is suboptimal because if there's a large amount of events, it means there's a lot of manual work to be done.
Relatedly, I can see the same issue arising on printing function args related to #506, so it might be helpful to tackle these 2 together.
Describe the solution you'd like
Define some encoding rules (e.g. all
Bytes
should behex::encode
'd before printing them) and implementDisplay
for allevent
andfunction
structs emitted byabigen
.The text was updated successfully, but these errors were encountered: