I have some questions that about custom data structure in ink!.
https://paritytech.github.io/ink-docs/faq#what-are-the-scaleencode-and-scaledecode-traits. I already implemented some features with pallet and using the Encode, Decode trait is straight forward to me.
However, there is also a section using some advance storage feature of ink!. https://paritytech.github.io/ink-docs/datastructures/custom-datastructure
I’m kinda confused that which approach to use?
Encode
,Decode
" or "Implement some storage layout trait". And what the difference between these two approaches.Encode
,Decode
allows serialization, deserialization of a struct into single bytes as we know, which also means that if we don't deriveSpreadLayout
for that custom struct, the default storage layout for that struct isPackedLayout
and the struct data is packed into one single cell. Can you confirm this? Because that is exactly what I want to know. @DanShield