mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
accounts: more linters (#24783)
This commit is contained in:
parent
13eef32998
commit
9dda5b9819
4 changed files with 4 additions and 7 deletions
|
|
@ -1073,9 +1073,7 @@ func TestABI_EventById(t *testing.T) {
|
||||||
}
|
}
|
||||||
if event == nil {
|
if event == nil {
|
||||||
t.Errorf("We should find a event for topic %s, test #%d", topicID.Hex(), testnum)
|
t.Errorf("We should find a event for topic %s, test #%d", topicID.Hex(), testnum)
|
||||||
}
|
} else if event.ID != topicID {
|
||||||
|
|
||||||
if event.ID != topicID {
|
|
||||||
t.Errorf("Event id %s does not match topic %s, test #%d", event.ID.Hex(), topicID.Hex(), testnum)
|
t.Errorf("Event id %s does not match topic %s, test #%d", event.ID.Hex(), topicID.Hex(), testnum)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -620,8 +620,7 @@ func TestHeaderByNumber(t *testing.T) {
|
||||||
}
|
}
|
||||||
if latestBlockHeader == nil {
|
if latestBlockHeader == nil {
|
||||||
t.Errorf("received a nil block header")
|
t.Errorf("received a nil block header")
|
||||||
}
|
} else if latestBlockHeader.Number.Uint64() != uint64(0) {
|
||||||
if latestBlockHeader.Number.Uint64() != uint64(0) {
|
|
||||||
t.Errorf("expected block header number 0, instead got %v", latestBlockHeader.Number.Uint64())
|
t.Errorf("expected block header number 0, instead got %v", latestBlockHeader.Number.Uint64())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -384,7 +384,7 @@ func TestUpdatedKeyfileContents(t *testing.T) {
|
||||||
time.Sleep(1000 * time.Millisecond)
|
time.Sleep(1000 * time.Millisecond)
|
||||||
|
|
||||||
// Now replace file contents with crap
|
// Now replace file contents with crap
|
||||||
if err := os.WriteFile(file, []byte("foo"), 0644); err != nil {
|
if err := os.WriteFile(file, []byte("foo"), 0600); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ func TestKeyEncryptDecrypt(t *testing.T) {
|
||||||
t.Errorf("test %d: key address mismatch: have %x, want %x", i, key.Address, address)
|
t.Errorf("test %d: key address mismatch: have %x, want %x", i, key.Address, address)
|
||||||
}
|
}
|
||||||
// Recrypt with a new password and start over
|
// Recrypt with a new password and start over
|
||||||
password += "new data appended"
|
password += "new data appended" // nolint: gosec
|
||||||
if keyjson, err = EncryptKey(key, password, veryLightScryptN, veryLightScryptP); err != nil {
|
if keyjson, err = EncryptKey(key, password, veryLightScryptN, veryLightScryptP); err != nil {
|
||||||
t.Errorf("test %d: failed to recrypt key %v", i, err)
|
t.Errorf("test %d: failed to recrypt key %v", i, err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue