Skip to content

Commit

Permalink
Update logic on version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Bez625 committed Jan 10, 2025
1 parent ab4175b commit 79a5ffa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions http/submitattestations.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (s *Service) SubmitAttestations(ctx context.Context, opts *api.SubmitAttest
}

func createUnversionedAttestations(attestations []*spec.VersionedAttestation) ([]any, error) {
var version *spec.DataVersion
var version spec.DataVersion
var unversionedAttestations []any

for i := range attestations {
Expand All @@ -76,9 +76,9 @@ func createUnversionedAttestations(attestations []*spec.VersionedAttestation) ([
}

// Ensure consistent versioning.
if version == nil {
version = &attestations[i].Version
} else if *version != attestations[i].Version {
if version == spec.DataVersionUnknown {
version = attestations[i].Version
} else if version != attestations[i].Version {
return nil, errors.Join(errors.New("attestations must all be of the same version"), client.ErrInvalidOptions)
}

Expand Down

0 comments on commit 79a5ffa

Please sign in to comment.