alloy-rs / core

High-performance, well-tested & documented core libraries for Ethereum, in Rust
https://alloy.rs
Apache License 2.0
758 stars 131 forks source link

feat(dyn-abi): derive Default for TypedData #664

Closed DaniPopes closed 2 months ago

DaniPopes commented 2 months ago

cc @prestwich is this right or does this need a custom impl to handle resolver/..?

DaniPopes commented 2 months ago

What's a sensible default for no-op / testing then?

prestwich commented 2 months ago

I think it'd be okay if default is always invalid

I would be very against this

why not just add a cfg_attr(test, derive(Default))

mattsse commented 2 months ago

this only works internally I think

prestwich commented 2 months ago

instead of proposing a feature, can you talk about the need? what are you trying to test?

DaniPopes commented 2 months ago

dummy input to eth_signTypedData, currently I can only instatiate it from json or sol struct

prestwich commented 2 months ago

sure but do you want input that's going to cause an error, GIGO, or something else?

gakonst commented 2 months ago

if useful for testing we have used test-utils features in the past instead of cfg_attr(test), and i'd be ok w it