From 6cf347ddeae00e645494f5c7ec722c217339ac7d Mon Sep 17 00:00:00 2001 From: mdulin2 Date: Fri, 22 Nov 2024 11:51:13 -0800 Subject: [PATCH] Add entry to golinter for hardcoded credentials being ignored in test file --- .golangci.yml | 2 ++ node/pkg/transfer-verifier/transfer-verifier-sui.go | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 6a320b8180..e55efad1e0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -28,3 +28,5 @@ issues: text: "^func.*supervisor.*(waitSettle|waitSettleError).*$" linters: - unused + - path: pkg/transfer-verifier/transfer-verifier-sui_test.go + text: "G101: Potential hardcoded credentials" diff --git a/node/pkg/transfer-verifier/transfer-verifier-sui.go b/node/pkg/transfer-verifier/transfer-verifier-sui.go index 58c71e5b73..b731658f11 100644 --- a/node/pkg/transfer-verifier/transfer-verifier-sui.go +++ b/node/pkg/transfer-verifier/transfer-verifier-sui.go @@ -61,7 +61,7 @@ func (s *SuiTransferVerifier) GetEventFilter() string { // that maps the token address and chain ID to the amount requested out of the bridge. It does not return an error, because any faulty // events can be skipped, since they would likely fail being processed by the guardian as well. Debug level logging can be used to // reveal any potential locations where errors are occurring. -func (s *SuiTransferVerifier) processEvents(events []SuiEvent, logger *zap.Logger) (requestedOutOfBridge map[string]*big.Int, numEventsProcessed int) { +func (s *SuiTransferVerifier) processEvents(events []SuiEvent, logger *zap.Logger) (requestedOutOfBridge map[string]*big.Int, numEventsProcessed uint) { // Initialize the map to store the amount requested out of the bridge requestedOutOfBridge = make(map[string]*big.Int) @@ -205,9 +205,10 @@ func (s *SuiTransferVerifier) ProcessDigest(digest string, suiApiConnection SuiA zap.String("amountIn", amountIn.String())) } - logger.Info("Digest processed", zap.String("txDigest", digest), zap.Int("numEventsProcessed", numEventsProcessed), zap.Int("numChangesProcessed", numChangesProcessed)) + //nolint:gosec + logger.Info("Digest processed", zap.String("txDigest", digest), zap.Int("numEventsProcessed", int(numEventsProcessed)), zap.Int("numChangesProcessed", numChangesProcessed)) - return uint(numEventsProcessed), nil + return numEventsProcessed, nil } type SuiApiResponse interface {