Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
omerlavanet committed Dec 18, 2024
1 parent 58da257 commit 573e60c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func (jm JsonrpcMessage) CheckResponseError(data []byte, httpStatusCode int) (ha
return false, ""
}
if result.Error.Data != nil {
if result.Error.Data.(string) != "" {
return true, result.Error.Message + ",data: " + result.Error.Data.(string)
if st, ok := result.Error.Data.(string); ok && st != "" {
return true, result.Error.Message + ",data: " + st
}
}
return result.Error.Message != "", result.Error.Message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func (jm TendermintrpcMessage) CheckResponseError(data []byte, httpStatusCode in
return false, ""
}
if result.Error.Data != nil {
if result.Error.Data.(string) != "" {
return true, result.Error.Message + ",data: " + result.Error.Data.(string)
if st, ok := result.Error.Data.(string); ok && st != "" {
return true, result.Error.Message + ",data: " + st
}
}
return result.Error.Message != "", result.Error.Message
Expand Down
1 change: 0 additions & 1 deletion protocol/integration/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2336,7 +2336,6 @@ func TestUnconfiguredApiWithArchiveRequest(t *testing.T) {
isError, _ := rpcConsumerOut.rpcConsumerServer.ChainParser.IdentifyNodeError("Internal error,data: height 777 must be less than or equal to the current blockchain height 1001", chainlib.LATEST)
require.False(t, isError)
}

})
}
}
1 change: 0 additions & 1 deletion protocol/parser/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,4 @@ func TestLongestCommonSubsequenceWithFormat(t *testing.T) {
require.Equal(t, play.len, len)
})
}

}
3 changes: 1 addition & 2 deletions protocol/rpcconsumer/rpcconsumer_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ func (rpccs *RPCConsumerServer) ExtensionsSupported(internalPath string, extensi

const (
RetryInterval = 10 * time.Minute // time for retrying on failure
RefreshInterval = 3 * 24 * time.Hour // time for refreshing on success, so if somehting changes lava adapts
RefreshInterval = 3 * 24 * time.Hour // time for refreshing on success, so if something changes lava adapts
)

func (rpccs *RPCConsumerServer) tryExtractNodeData(ctx context.Context) {
Expand Down Expand Up @@ -1756,7 +1756,6 @@ func fetchFormattedBlock(ctx context.Context, chainFetcher *chainlib.ChainFetche
// re := regexp.MustCompile(fmt.Sprintf(`%s`, regexp.QuoteMeta(formatted)))
blockError = re.ReplaceAllString(responseErrorMessage, "$1"+format+"$3")
if blockError == responseErrorMessage {

return "", false
}
return blockError, true
Expand Down

0 comments on commit 573e60c

Please sign in to comment.