Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Nov 16, 2023
1 parent 90f63c1 commit b4eb387
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion vcr/pe/presentation_submission.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (s PresentationSubmission) Validate(presentation vc.VerifiablePresentation,
return nil, fmt.Errorf("credential submission is invalid: %w", err)
}
if len(expectedCredentials) == 0 {
return nil, errors.New("credential submission is invalid, credentials does not match the presentation definition")
return nil, errors.New("credential submission is invalid, credentials do not match the presentation definition")
}
// Marshal, then unmarshal descriptor mappings into interface{}, to make sure ordering and zero-handling is the same for both.
// Then, they can simply be compared to check that the submission
Expand Down
12 changes: 2 additions & 10 deletions vcr/pe/presentation_submission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,10 @@ func TestPresentationSubmission_Validate(t *testing.T) {
},
},
}
submission := PresentationSubmission{
DescriptorMap: []InputDescriptorMappingObject{
{
Id: "1",
Path: "$.verifiableCredential[0].id",
},
},
}

credentials, err := submission.Validate(vp, definition)
credentials, err := PresentationSubmission{}.Validate(vp, definition)

assert.EqualError(t, err, "credential submission is invalid, credentials does not match the presentation definition")
assert.EqualError(t, err, "credential submission is invalid, credentials do not match the presentation definition")
assert.Empty(t, credentials)
})
t.Run("credentials match wrong input descriptors", func(t *testing.T) {
Expand Down

0 comments on commit b4eb387

Please sign in to comment.