Skip to content

Commit

Permalink
fix gosec err
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Aug 1, 2024
1 parent a5e6e70 commit d37ea07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/zetaclientd/solana_test_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func createSolanaTestKeyFile(keyFile string) error {
}

// create file (or overwrite if it already exists)
// #nosec G304 -- for E2E testing purposes only
file, err := os.Create(keyFile)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions zetaclient/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func (c Config) LoadSolanaPrivateKey() (solana.PrivateKey, error) {
fileName := path.Join(c.ZetaCoreHome, c.SolanaKeyFile)

Check warning on line 171 in zetaclient/config/types.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/config/types.go#L171

Added line #L171 was not covered by tests

// load the gateway keypair from a JSON file
// #nosec G304 -- user is allowed to specify the key file
fileContent, err := os.ReadFile(fileName)
if err != nil {
return solana.PrivateKey{}, errors.Wrapf(err, "unable to read Solana key file: %s", fileName)

Check warning on line 177 in zetaclient/config/types.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/config/types.go#L175-L177

Added lines #L175 - L177 were not covered by tests
Expand Down

0 comments on commit d37ea07

Please sign in to comment.