Skip to content

Commit 392cf6f

Browse files
committed
Linter fixes
1 parent 1041add commit 392cf6f

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

internal/api/verification.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@ func (s *Server) CheckVerification(ctx context.Context, request CheckVerificatio
4343
// Use the VerificationService to check for existing response or query
4444
response, query, err := s.verificationService.GetVerificationStatus(ctx, *issuerDID, verificationQueryID)
4545
if err != nil {
46-
//if error is not found, return 404
46+
// if error is not found, return 404
4747
if err.Error() == "verification query not found" {
4848
log.Error(ctx, "checking verification, not found", "err", err, "issuerDID", issuerDID, "id", verificationQueryID)
4949
return CheckVerification404JSONResponse{N404JSONResponse{Message: "Verification query not found"}}, nil
5050
} else {
5151
log.Error(ctx, "checking verification", "err", err, "issuerDID", issuerDID, "id", verificationQueryID)
5252
return CheckVerification500JSONResponse{N500JSONResponse{Message: err.Error()}}, nil
5353
}
54-
5554
}
5655

5756
// Check if a response exists

internal/api/verification_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ import (
1010
"testing"
1111

1212
"github.com/google/uuid"
13-
"github.com/jackc/pgtype"
14-
1513
core "github.com/iden3/go-iden3-core/v2"
16-
14+
"github.com/jackc/pgtype"
1715
"github.com/stretchr/testify/assert"
1816
"github.com/stretchr/testify/require"
1917

internal/core/services/verification.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ type scope struct {
2929
Id uint32 `json:"id"`
3030
Params json.RawMessage `json:"params,omitempty"`
3131
Query json.RawMessage `json:"query"`
32-
// TransactionData *transactionData `json:"transactionData,omitempty"`
33-
}
34-
35-
// TransactionData is a property of Scope, and it's required for the authRequest
36-
type transactionData struct {
37-
ChainID int `json:"chainID"`
38-
ContractAddress string `json:"contractAddress"`
39-
MethodID string `json:"methodID"`
40-
Network string `json:"network"`
4132
}
4233

4334
const (
@@ -91,7 +82,7 @@ func (vs *VerificationService) CreateVerificationQuery(ctx context.Context, issu
9182

9283
verificationQuery.ID = queryID
9384

94-
authRequest, err := vs.getAuthRequestOffChain(&verificationQuery, serverURL)
85+
authRequest, err := vs.getAuthRequestOffChain(ctx, &verificationQuery, serverURL)
9586
if err != nil {
9687
return nil, fmt.Errorf("failed to generate auth request: %w", err)
9788
}
@@ -171,7 +162,7 @@ func (s *VerificationService) key(id uuid.UUID) string {
171162
return "issuer-node:qr-code:" + id.String()
172163
}
173164

174-
func (vs *VerificationService) getAuthRequestOffChain(req *domain.VerificationQuery, serverURL string) (protocol.AuthorizationRequestMessage, error) {
165+
func (vs *VerificationService) getAuthRequestOffChain(ctx context.Context, req *domain.VerificationQuery, serverURL string) (protocol.AuthorizationRequestMessage, error) {
175166
id := uuid.NewString()
176167
authReq := auth.CreateAuthorizationRequest(vs.getReason(nil), req.IssuerDID, vs.getUri(serverURL, req.IssuerDID, req.ID))
177168
authReq.ID = id
@@ -182,7 +173,7 @@ func (vs *VerificationService) getAuthRequestOffChain(req *domain.VerificationQu
182173
if req.Scope.Status == pgtype.Present {
183174
err := json.Unmarshal(req.Scope.Bytes, &scopes)
184175
if err != nil {
185-
log.Error(context.Background(), "failed to unmarshal scope", "error", err)
176+
log.Error(ctx, "failed to unmarshal scope", "error", err)
186177
return protocol.AuthorizationRequestMessage{}, fmt.Errorf("failed to unmarshal scope: %w", err)
187178
}
188179
}

0 commit comments

Comments
 (0)