fix: lint (#2845)
Co-authored-by: Samuel Hawksby-Robinson <samuel@samyoul.com>
This commit is contained in:
parent
bf9abfc350
commit
b8fd999b54
|
@ -95,9 +95,5 @@ func StringToTopic(s string) (t TopicType) {
|
|||
}
|
||||
|
||||
func TopicTypeToByteArray(t TopicType) []byte {
|
||||
topic := make([]byte, 4)
|
||||
for i, b := range t {
|
||||
topic[i] = b
|
||||
}
|
||||
return topic
|
||||
return t[:4]
|
||||
}
|
||||
|
|
|
@ -936,7 +936,7 @@ func (s *MessengerContactRequestSuite) TestLegacyContactRequestNotifications() {
|
|||
myID := types.EncodeHex(crypto.FromECDSAPub(&s.m.identity.PublicKey))
|
||||
|
||||
// Send contact request
|
||||
resp, err = s.m.SendContactRequest(context.Background(), crRequest)
|
||||
_, err = s.m.SendContactRequest(context.Background(), crRequest)
|
||||
s.Require().NoError(err)
|
||||
|
||||
paginationResponse, err := theirMessenger.ActivityCenterNotifications("", 10)
|
||||
|
|
|
@ -66,12 +66,8 @@ func ValidateTags(input []string) bool {
|
|||
}
|
||||
}
|
||||
|
||||
if len(unique(input)) != len(input) {
|
||||
// Contains duplicates. Shouldn't have happened
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
// False if contains duplicates. Shouldn't have happened
|
||||
return len(unique(input)) == len(input)
|
||||
}
|
||||
|
||||
func RemoveUnknownAndDeduplicateTags(input []string) []string {
|
||||
|
|
|
@ -396,7 +396,7 @@ func challengeMiddleware(ps *PairingServer, next http.Handler) http.HandlerFunc
|
|||
|
||||
// Only if we have both a challenge in the session store and in the request header
|
||||
// do we entertain blocking the client. Because then we know someone is trying to be sneaky.
|
||||
if bytes.Compare(c, challenge) != 0 {
|
||||
if !bytes.Equal(c, challenge) {
|
||||
s.Values[sessionBlocked] = true
|
||||
err = s.Save(r, w)
|
||||
if err != nil {
|
||||
|
|
|
@ -198,7 +198,7 @@ func (pms *PayloadMarshallerSuite) TestPayloadMarshaller_MarshalToProtobuf() {
|
|||
|
||||
// Because file-walk will pull files in an unpredictable order from a target dir
|
||||
// there are 2 potential valid hashes, because there are 2 key files in the test dir
|
||||
if bytes.Compare(hashA, h.Sum(nil)) != 0 {
|
||||
if !bytes.Equal(hashA, h.Sum(nil)) {
|
||||
pms.Require().Exactly(hashB, h.Sum(nil))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ type ServerURLSuite struct {
|
|||
|
||||
server *MediaServer
|
||||
serverNoPort *MediaServer
|
||||
pairingServer *PairingServer
|
||||
}
|
||||
|
||||
func (s *ServerURLSuite) SetupSuite() {
|
||||
|
|
|
@ -312,10 +312,7 @@ func (api *API) generateAccount(
|
|||
|
||||
func (api *API) VerifyPassword(password string) bool {
|
||||
err := api.verifyPassword(password)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return err == nil
|
||||
}
|
||||
|
||||
func (api *API) AddMigratedKeyPair(ctx context.Context, kcUID string, kpName string, keyUID string, accountAddresses []string) error {
|
||||
|
|
|
@ -118,5 +118,5 @@ func (args SendTxArgs) ToTransactOpts(signerFn bind.SignerFn) *bind.TransactOpts
|
|||
}
|
||||
|
||||
func isNilOrEmpty(bytes types.HexBytes) bool {
|
||||
return bytes == nil || len(bytes) == 0
|
||||
return len(bytes) == 0
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue