Skip to content

Commit

Permalink
Chore: minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Dec 8, 2023
1 parent e3dafa9 commit 4e24707
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
4 changes: 2 additions & 2 deletions core/build_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (
)

// GitCommit holds the latest git commit hash for this build.
var GitCommit string = "0"
var GitCommit = "0"

// GitVersion holds the tagged version belonging to the git commit.
var GitVersion string

// GitBranch holds the branch from where the binary is built.
var GitBranch string = "development"
var GitBranch = "development"

// Version gives the current version according to the git tag or the branch if there's no tag.
func Version() string {
Expand Down
2 changes: 1 addition & 1 deletion discovery/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/google/uuid"
"github.com/nuts-foundation/go-did/vc"
"github.com/nuts-foundation/nuts-node/discovery/log"
credential "github.com/nuts-foundation/nuts-node/vcr/credential"
"github.com/nuts-foundation/nuts-node/vcr/credential"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"gorm.io/gorm/clause"
Expand Down
9 changes: 0 additions & 9 deletions network/transport/grpc/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
package grpc

import (
"context"
"fmt"
"github.com/nuts-foundation/go-did/did"
"github.com/nuts-foundation/nuts-node/network/transport"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
"strings"
"time"
)

func readMetadata(md metadata.MD) (transport.PeerID, did.DID, error) {
Expand Down Expand Up @@ -71,10 +69,3 @@ func readMetadata(md metadata.MD) (transport.PeerID, did.DID, error) {
func GetStreamMethod(serviceName string, stream grpc.StreamDesc) string {
return fmt.Sprintf("/%s/%s", serviceName, stream.StreamName)
}

func sleepWithCancel(ctx context.Context, duration time.Duration) {
select {
case <-ctx.Done():
case <-time.After(duration):
}
}
12 changes: 6 additions & 6 deletions pki/denylist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,37 +128,37 @@ func denylistTestServer(denylist string) *httptest.Server {
func trustedDenylist(t *testing.T) string {
// Build the denylist contents
entries := []denylistEntry{
denylistEntry{
{
Issuer: `FOO`,
SerialNumber: `123`,
JWKThumbprint: `bim`,
Reason: `bap`,
},
denylistEntry{
{
Issuer: `BAR`,
SerialNumber: `456`,
JWKThumbprint: `bam`,
Reason: `bar`,
},
denylistEntry{
{
Issuer: ``,
SerialNumber: bannedCertSerialNumber,
JWKThumbprint: `PVOjk-5d4Lb-FGxurW-fNMUv3rYZZBWF3gGaP5s1UVQ`,
Reason: `baz1`,
},
denylistEntry{
{
Issuer: bannedCertIssuer,
SerialNumber: ``,
JWKThumbprint: ``,
Reason: `baz2`,
},
denylistEntry{
{
Issuer: bannedCertIssuer,
SerialNumber: bannedCertSerialNumber,
JWKThumbprint: `PVOjk-5d4Lb-FGxurW-fNMUv3rYZZBWF3gGaP5s1UVQ`,
Reason: `baz3`,
},
denylistEntry{
{
Issuer: bannedCertIssuer + `arst`,
SerialNumber: bannedCertSerialNumber,
JWKThumbprint: `PVOjk-5d4Lb-FGxurW-fNMUv3rYZZBWF3gGaP5s1UVQ`,
Expand Down
2 changes: 1 addition & 1 deletion vcr/issuer/network_publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/nuts-foundation/nuts-node/crypto"
"github.com/nuts-foundation/nuts-node/network"
"github.com/nuts-foundation/nuts-node/vcr/credential"
types "github.com/nuts-foundation/nuts-node/vcr/types"
"github.com/nuts-foundation/nuts-node/vcr/types"
"github.com/nuts-foundation/nuts-node/vdr"
"github.com/nuts-foundation/nuts-node/vdr/resolver"
"github.com/stretchr/testify/assert"
Expand Down

0 comments on commit 4e24707

Please sign in to comment.