Skip to content

Commit

Permalink
rename, test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Nov 22, 2023
1 parent 819874c commit 2ffe849
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions vcr/pe/presentation_submission.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,18 +281,18 @@ func (s PresentationSubmission) Validate(presentations []vc.VerifiablePresentati
if err != nil {
return nil, err
}
expectedCredenials, err := expectedPresentationSubmission.Resolve(presentations)
expectedCredentials, err := expectedPresentationSubmission.Resolve(presentations)
if err != nil {
return nil, err
}

if len(actualCredentials) != len(expectedCredenials) {
return nil, fmt.Errorf("expected %d credentials, got %d", len(expectedCredenials), len(actualCredentials))
if len(actualCredentials) != len(expectedCredentials) {
return nil, fmt.Errorf("expected %d credentials, got %d", len(expectedCredentials), len(actualCredentials))
}
for inputDescriptorID, expectedCredential := range expectedCredenials {
for inputDescriptorID, expectedCredential := range expectedCredentials {
if actualCredentials[inputDescriptorID].Raw() != expectedCredential.Raw() {
return nil, fmt.Errorf("incorrect mapping for input descriptor : %s", inputDescriptorID)
}
}
return expectedCredenials, nil
return expectedCredentials, nil
}
2 changes: 1 addition & 1 deletion vcr/pe/presentation_submission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func TestPresentationSubmission_Validate(t *testing.T) {
vcID := ssi.MustParseURI("did:example:123#first-vc")
vp := vc.VerifiablePresentation{
VerifiableCredential: []vc.VerifiableCredential{
{ID: &vcID},
credentialToJSONLD(vc.VerifiableCredential{ID: &vcID}),
},
Proof: []interface{}{
proof.LDProof{VerificationMethod: vcID},
Expand Down

0 comments on commit 2ffe849

Please sign in to comment.