Closed otherview closed 2 months ago
Attention: Patch coverage is 75.00000%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 61.37%. Comparing base (
88baecd
) to head (0849209
). Report is 1 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
genesis/customnet.go | 66.66% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Was able to confirm that this does not generate any errors in a running network.
Ran the following test:
latest
version and 2 Auth + 1 Public nodes with this branch )thor-e2e-test
against both nodes running latest and nodes running this branch.I think it looks good to merge.
Description
Fix for
genesis.CustomGenesis
serialization. The(i *HexOrDecimal256) MarshalJSON()
and the(b *Bytes32) MarshalJSON()
were working incorrectly. This was found when thenetworkHub
was trying to writegenesis.CustomGenesis
to file andthor
nodes were loading the genesis back. Both operations were erroring with different reasons.HexOrDecimal256
MarshalJSON was returning a String instead of a Json objectJSONMarshalling of
HexOrDecimal256
would fail because a string is not a JSON ( needs to be "string" )Bytes32
MarshalJSON was returning a JSON string of an array of an hex encoded string instead of a JSON string of the hex encoded stringJSONUnmarshalling of
Bytes32
would fail because it would expect a JSON string of Hex enconded value ( expected "0x00000..." received from the Marshaller "[0 12 0 ... 0]"As an interesting note: Nilled or zeroed
Bytes32
variable (zero := Bytes32{}
) always marshalls to0x000...
instead ofnil
. This PR does not change this as it might create upstream issues.The PR also:
HexOrDecimal256
Bytes32
Marshal/Unmarshal andgenesis.CustomGenesis
MarshalType of change
Please delete options that are not relevant.
How Has This Been Tested?
Added tests
Checklist: