@@ 41,7 41,6 @@ func NewElection(candidates []Candidate, createEventId id.EventID,
func (el *Election) UnmarshalJSON(b []byte) error {
type Alias Election // create alias to prevent endless loop
tmp := (*Alias)(el)
-
err := json.Unmarshal(b, tmp)
if err != nil {
return err
@@ 50,5 49,9 @@ func (el *Election) UnmarshalJSON(b []byte) error {
if el.LocalVoter != nil {
el.Joins[el.LocalVoter.JoinEvt.ID] = el.LocalVoter.Voter
}
+ for _, voter := range el.Joins {
+ // TODO: for some reason I can't get this to work in (*Voter).UnmarshalJSON
+ voter.JoinEvt.Content.ParseRaw(JoinElectionMessage)
+ }
return nil
}