Closed paulhauner closed 6 years ago
I'm missing something. What is wrong with the current output?
b'\x00\x00\x00\x00'
is invalid because there are 3x length bytes and 1x data bytes (4 bytes) however the length bytes read 0
.
So it's saying "the length of this thing is zero" however that's wrong because there is a byte following it.
Therefore I expect: b'\x00\x00\x01\x00'
which says "there's one byte here" and when you read it you find it equals zero.
Does that help?
Alrighty, turns out this was a misunderstanding -- I was getting my wires crossed between the implementations.
I'm going to close this as it's not relevant anymore.
Here is the output of simpleserialize (ssz) when serializing a zero value.
I think the output should either be:
b'\x00\x00\x01\x00'
b'\x00\x00\x00'
Option (2) is shorter, but I prefer (1) because it's simpler to implement and more consistent.
I could go either way at this stage.