Skip to content

Commit

Permalink
fix staticcheck reports
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Mar 9, 2023
1 parent 727c965 commit e374ab6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion data/ipfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

ipfscid "github.com/ipfs/go-cid"
files "github.com/ipfs/go-ipfs-files"
keystore "github.com/ipfs/go-ipfs-keystore"
files "github.com/ipfs/go-libipfs/files"
ipfslog "github.com/ipfs/go-log"
coreiface "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/options"
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ require (
github.com/iden3/go-rapidsnark/verifier v0.0.3
github.com/iden3/go-rapidsnark/witness v0.0.3
github.com/ipfs/go-cid v0.3.2
github.com/ipfs/go-ipfs-files v0.3.0
github.com/ipfs/go-ipfs-keystore v0.1.0
github.com/ipfs/go-libipfs v0.6.1-0.20230228004237-36918f45f260
github.com/ipfs/go-log v1.0.5
github.com/ipfs/interface-go-ipfs-core v0.11.0
github.com/ipfs/kubo v0.19.0-rc1
Expand Down Expand Up @@ -181,7 +181,6 @@ require (
github.com/ipfs/go-ipld-git v0.1.1 // indirect
github.com/ipfs/go-ipld-legacy v0.1.1 // indirect
github.com/ipfs/go-ipns v0.3.0 // indirect
github.com/ipfs/go-libipfs v0.6.1-0.20230228004237-36918f45f260 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/ipfs/go-merkledag v0.9.0 // indirect
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1095,8 +1095,6 @@ github.com/ipfs/go-ipfs-exchange-offline v0.2.0/go.mod h1:HjwBeW0dvZvfOMwDP0TSKX
github.com/ipfs/go-ipfs-exchange-offline v0.3.0 h1:c/Dg8GDPzixGd0MC8Jh6mjOwU57uYokgWRFidfvEkuA=
github.com/ipfs/go-ipfs-exchange-offline v0.3.0/go.mod h1:MOdJ9DChbb5u37M1IcbrRB02e++Z7521fMxqCNRrz9s=
github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4=
github.com/ipfs/go-ipfs-files v0.3.0 h1:fallckyc5PYjuMEitPNrjRfpwl7YFt69heCOUhsbGxQ=
github.com/ipfs/go-ipfs-files v0.3.0/go.mod h1:xAUtYMwB+iu/dtf6+muHNSFQCJG2dSiStR2P6sn9tIM=
github.com/ipfs/go-ipfs-keystore v0.1.0 h1:gfuQUO/cyGZgZIHE6OrJas4OnwuxXCqJG7tI0lrB5Qc=
github.com/ipfs/go-ipfs-keystore v0.1.0/go.mod h1:LvLw7Qhnb0RlMOfCzK6OmyWxICip6lQ06CCmdbee75U=
github.com/ipfs/go-ipfs-pinner v0.3.0 h1:jwe5ViX3BON3KgOAYrrhav2+1ONB0QzFAWQd7HUlbuM=
Expand Down
9 changes: 7 additions & 2 deletions rpcclient/util.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package rpcclient

import (
"crypto/rand"
"encoding/hex"
"encoding/json"
"fmt"
"math/rand"
"math/big"
"os"
"time"

Expand Down Expand Up @@ -269,7 +270,11 @@ func genVote(encrypted bool, keys []string) ([]byte, error) {
return nil, fmt.Errorf("cannot decode encryption key with index %d: (%s)", i, err)
}
if first {
vp.Nonce = RandomHex(rand.Intn(16) + 16)
randInt, err := rand.Int(rand.Reader, big.NewInt(16))
if err != nil {
return nil, err
}
vp.Nonce = RandomHex(int(randInt.Int64()) + 16)
vpBytes, err = json.Marshal(vp)
if err != nil {
return nil, err
Expand Down

0 comments on commit e374ab6

Please sign in to comment.