mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
Lint fixes
This commit is contained in:
parent
e155b7f985
commit
0275ff5369
@ -250,6 +250,7 @@ func (a *Address) checksumHex() []byte {
|
||||
|
||||
// compute checksum
|
||||
sha := sha3.NewLegacyKeccak256()
|
||||
//nolint:errcheck
|
||||
sha.Write(buf[2:])
|
||||
hash := sha.Sum(nil)
|
||||
for i := 2; i < len(buf); i++ {
|
||||
|
@ -73,7 +73,9 @@ func NewKeccakState() KeccakState {
|
||||
// HashData hashes the provided data using the KeccakState and returns a 32 byte hash
|
||||
func HashData(kh KeccakState, data []byte) (h common.Hash) {
|
||||
kh.Reset()
|
||||
//nolint:errcheck
|
||||
kh.Write(data)
|
||||
//nolint:errcheck
|
||||
kh.Read(h[:])
|
||||
return h
|
||||
}
|
||||
|
@ -46,7 +46,9 @@ func TestSignify(t *testing.T) {
|
||||
|
||||
data := make([]byte, 1024)
|
||||
rand.Read(data)
|
||||
tmpFile.Write(data)
|
||||
if _, err = tmpFile.Write(data); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err = tmpFile.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
@ -90,7 +92,9 @@ func TestSignifyTrustedCommentTooManyLines(t *testing.T) {
|
||||
|
||||
data := make([]byte, 1024)
|
||||
rand.Read(data)
|
||||
tmpFile.Write(data)
|
||||
if _, err = tmpFile.Write(data); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err = tmpFile.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
@ -115,7 +119,9 @@ func TestSignifyTrustedCommentTooManyLinesLF(t *testing.T) {
|
||||
|
||||
data := make([]byte, 1024)
|
||||
rand.Read(data)
|
||||
tmpFile.Write(data)
|
||||
if _, err = tmpFile.Write(data); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err = tmpFile.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
@ -140,7 +146,9 @@ func TestSignifyTrustedCommentEmpty(t *testing.T) {
|
||||
|
||||
data := make([]byte, 1024)
|
||||
rand.Read(data)
|
||||
tmpFile.Write(data)
|
||||
if _, err = tmpFile.Write(data); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err = tmpFile.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
|
@ -42,7 +42,9 @@ func (e *testEncoder) EncodeRLP(w io.Writer) error {
|
||||
if e.err != nil {
|
||||
return e.err
|
||||
}
|
||||
w.Write([]byte{0, 1, 0, 1, 0, 1, 0, 1, 0, 1})
|
||||
if _, err := w.Write([]byte{0, 1, 0, 1, 0, 1, 0, 1, 0, 1}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,9 @@ func TestHTTPRespBodyUnlimited(t *testing.T) {
|
||||
|
||||
s := NewServer()
|
||||
defer s.Stop()
|
||||
s.RegisterName("test", largeRespService{respLength})
|
||||
if err := s.RegisterName("test", largeRespService{respLength}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ts := httptest.NewServer(s)
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -168,7 +168,9 @@ func TestClientWebsocketLargeMessage(t *testing.T) {
|
||||
defer httpsrv.Close()
|
||||
|
||||
respLength := wsMessageSizeLimit - 50
|
||||
srv.RegisterName("test", largeRespService{respLength})
|
||||
if err := srv.RegisterName("test", largeRespService{respLength}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
c, err := DialWebsocket(context.Background(), wsURL, "")
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user