-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
In
ssv-spec/qbft/json_testutils.go
Lines 22 to 35 in 3bd357a
| func (c *Controller) Decode(data []byte) error { | |
| err := json.Unmarshal(data, &c) | |
| if err != nil { | |
| return errors.Wrap(err, "could not decode controller") | |
| } | |
| config := c.GetConfig() | |
| for _, i := range c.StoredInstances { | |
| if i != nil { | |
| i.config = config | |
| } | |
| } | |
| return nil | |
| } |
err := json.Unmarshal(data, &c)Here, c is a pointer receiver (*Controller), so &c is a pointer to a pointer (**Controller), which is not what json.Unmarshal expects. This results in unexpect deserialization.
Same issue in instance decoding.