Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: minor code cleanup #2662

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading