Skip to content

Commit

Permalink
unmarshal the time in the attestation collection correctly (#203)
Browse files Browse the repository at this point in the history
fix/202/we now unmarshal the time in the attestation collection correctly

Co-authored-by: Cole <[email protected]>
  • Loading branch information
colek42 and Cole authored Apr 3, 2024
1 parent 472dfc2 commit 9fb8891
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions attestation/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ func (c *CollectionAttestation) UnmarshalJSON(data []byte) error {
proposed := struct {
Type string `json:"type"`
Attestation json.RawMessage `json:"attestation"`
StartTime time.Time `json:"starttime"`
EndTime time.Time `json:"endtime"`
}{}

if err := json.Unmarshal(data, &proposed); err != nil {
Expand All @@ -83,6 +85,8 @@ func (c *CollectionAttestation) UnmarshalJSON(data []byte) error {

c.Type = proposed.Type
c.Attestation = newAttest
c.StartTime = proposed.StartTime
c.EndTime = proposed.EndTime
return nil
}

Expand Down

0 comments on commit 9fb8891

Please sign in to comment.