You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler will complain that primitive_types::H160 doesn't implement SpreadLayout. So it cannot derive PackedLayout for struct Config.
It would be nice if any data type implements Encode + Decode can be stored in the storage by packing as a bytes blob by default. In this case, H160 is defined outside in the crate primitive_types. I cannot easily implement a trait for that, unless I create a wrapper type and write the boilerplate code.
Tested with ink v3.3.1
The text was updated successfully, but these errors were encountered:
Hey, sorry for the late response here. As part of ink! 4.0 we've removed SpreadLayout, PackedLayout, et. al (see #1331). I'm gonna close this since you should be able to do this without any problems with ink! 4.0. If you can't feel free to re-open it.
Suppose we just want to write a simple contract to store some
H160
EVM contract address:The compiler will complain that
primitive_types::H160
doesn't implementSpreadLayout
. So it cannot derivePackedLayout
forstruct Config
.It would be nice if any data type implements
Encode + Decode
can be stored in the storage by packing as a bytes blob by default. In this case,H160
is defined outside in the crateprimitive_types
. I cannot easily implement a trait for that, unless I create a wrapper type and write the boilerplate code.Tested with ink v3.3.1
The text was updated successfully, but these errors were encountered: