Closed jtraglia closed 2 years ago
Can you share the generated go file?
I found the issue, it is not on the generated code but on this function that extends the uint64 array. It should be easy to fix.
Could you try the fix in #97 and see if it resolves the issue?
Yes, but I won't be able to today. On a day trip away from my workstation. Thank you for the quick fix!
@ferranbt Yes, it resolves the issue. Thanks!
Hi there. Noticed something that I believe is a bug in sszgen.
Given a structure with a
uint64
array field, the field will unmarshal to anil
value if (1) the array is empty and (2) the variable that callsUnmarshalSSZ
is not initialized. And if you swapuint64
forbyte
it works as expected.See the following program:
When executed, this will output:
On the other hand, if
dec.Bar
is initialized with anything (even an empty array), it will behave as expected:When executed, this will output:
Fixes: https://github.com/flashbots/go-boost-utils/issues/23