Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
corverroos committed Feb 28, 2023
1 parent 7832a27 commit 4b8044e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/consensus/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ func (t *transport) Broadcast(ctx context.Context, typ qbft.MsgType, duty core.D
}

// ProcessReceives processes received messages from the outer buffer until the context is closed.
//
//nolint:revive // False positive "extra empty line at the start of a block"
func (t *transport) ProcessReceives(ctx context.Context, outerBuffer chan msg) {
for {
select {
Expand Down
4 changes: 3 additions & 1 deletion dkg/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,16 @@ func writeKeysToDisk(datadir string, shares []share) error {

keysDir := path.Join(datadir, "/validator_keys")

if err := os.Mkdir(keysDir, os.ModePerm); err != nil {
if err := os.Mkdir(keysDir, os.ModePerm); err != nil { //nolint:gosec // We need to be able to write to this dir.
return errors.Wrap(err, "mkdir /validator_keys")
}

return keystore.StoreKeys(secrets, keysDir)
}

// writeLock writes the lock file to disk.
//
//nolint:gosec // False positive "Expect WriteFile permissions to be 0600 or less"
func writeLock(datadir string, lock cluster.Lock) error {
b, err := json.MarshalIndent(lock, "", " ")
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions eth2util/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func StoreKeys(secrets []tblsv2.PrivateKey, dir string) error {
return storeKeysInternal(secrets, dir, "keystore-%d.json")
}

//nolint:gosec // False positive "Expect WriteFile permissions to be 0600 or less"
func storeKeysInternal(secrets []tblsv2.PrivateKey, dir string, filenameFmt string, opts ...keystorev4.Option) error {
for i, secret := range secrets {
password, err := randomHex32()
Expand Down
2 changes: 1 addition & 1 deletion testutil/genchangelog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func run(gitRange string, output string, token string) error {
return err
}

if err := os.WriteFile(output, b, 0o644); err != nil {
if err := os.WriteFile(output, b, 0o644); err != nil { //nolint:gosec
return errors.Wrap(err, "write output")
}

Expand Down

0 comments on commit 4b8044e

Please sign in to comment.