Skip to content

Commit

Permalink
tests, todo
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Nov 29, 2023
1 parent 1cd95f6 commit 3a759fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func Test_CreateSystem(t *testing.T) {
system.VisitEngines(func(engine core.Engine) {
numEngines++
})
assert.Equal(t, 15, numEngines)
assert.Equal(t, 16, numEngines)
}

func Test_ClientCommand_ErrorHandlers(t *testing.T) {
Expand Down
9 changes: 6 additions & 3 deletions discovery/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,13 @@ func (m *Module) validateRegistration(definition ServiceDefinition, presentation
}
}
// VP must fulfill the PEX Presentation ServiceDefinition
// TODO: Use Validate() once PR is merged
// We don't have a PresentationSubmission, so we can't use Validate().
creds, _, err := definition.PresentationDefinition.Match(presentation.VerifiableCredential)
if err != nil || len(creds) != len(presentation.VerifiableCredential) {
return fmt.Errorf("presentation does not fulfill Presentation ServiceDefinition: %w", err)
if err != nil {
return err
}
if len(creds) != len(presentation.VerifiableCredential) {
return errors.New("presentation does not fulfill Presentation ServiceDefinition")
}
return nil
}
Expand Down
2 changes: 0 additions & 2 deletions vcr/credential/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import (
"errors"
"fmt"
"github.com/nuts-foundation/go-did/did"
"errors"
"github.com/nuts-foundation/go-did/did"
"github.com/nuts-foundation/go-did/vc"
"github.com/nuts-foundation/nuts-node/vcr/signature/proof"
)
Expand Down

0 comments on commit 3a759fc

Please sign in to comment.