Skip to content

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Oct 24, 2023
1 parent d0422ba commit a50e30d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/api/message/v3/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func validatePublishWelcomesRequest(req *proto.PublishWelcomesRequest) error {
return status.Errorf(codes.InvalidArgument, "invalid welcome message")
}
ciphertext := welcome.WelcomeMessage.GetV1().Ciphertext
if ciphertext == nil || len(ciphertext) == 0 {
if len(ciphertext) == 0 {
return status.Errorf(codes.InvalidArgument, "invalid welcome message")
}
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/message/v3/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ func newTestService(t *testing.T, ctx context.Context) (*Service, *bun.DB, *mock
ReaderDB: messageDb,
CleanerDB: messageDb,
})
require.NoError(t, err)
node, nodeCleanup := test.NewNode(t)
mlsValidationService := newMockedValidationService()

svc, err := NewService(node, log, messageStore, mlsStore, mlsValidationService)
require.NoError(t, err)

return svc, mlsDb, mlsValidationService, func() {
messageStore.Close()
Expand Down
1 change: 1 addition & 0 deletions pkg/store/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ func TestMlsMessagePublish(t *testing.T) {
response, err := store.Query(&messagev1.QueryRequest{
ContentTopics: []string{contentTopic},
})
require.NoError(t, err)
require.Len(t, response.Envelopes, 1)
require.Equal(t, response.Envelopes[0].Message, message)
require.Equal(t, response.Envelopes[0].ContentTopic, contentTopic)
Expand Down
3 changes: 2 additions & 1 deletion pkg/testing/random.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package testing

import (
cryptoRand "crypto/rand"
"math/rand"
"strings"
)
Expand All @@ -21,6 +22,6 @@ func RandomStringLower(n int) string {

func RandomBytes(n int) []byte {
b := make([]byte, n)
_, _ = rand.Read(b)
_, _ = cryptoRand.Read(b)
return b
}

0 comments on commit a50e30d

Please sign in to comment.