Skip to content

Commit

Permalink
skip gosec error in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Feb 12, 2024
1 parent d8a9bcf commit 4d13cc6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions x/emissions/client/tests/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@ func RandomBallotGenerator(numberOfBallots int, voterList []string) []*observerT
ballotStatus := []observerTypes.BallotStatus{observerTypes.BallotStatus_BallotFinalized_FailureObservation, observerTypes.BallotStatus_BallotFinalized_SuccessObservation}
min := 0
max := len(ballotStatus) - 1
// #nosec G404 randomness is not a security issue here
for i := 0; i < numberOfBallots; i++ {
ballots[i] = &observerTypes.Ballot{
Index: "",
BallotIdentifier: "TestBallot" + strconv.Itoa(i),
VoterList: voterList,
Votes: CreateRandomVoteList(len(voterList)),
ObservationType: observerTypes.ObservationType_InBoundTx,
BallotThreshold: sdk.MustNewDecFromStr("0.66"),
Index: "",
BallotIdentifier: "TestBallot" + strconv.Itoa(i),
VoterList: voterList,
Votes: CreateRandomVoteList(len(voterList)),
ObservationType: observerTypes.ObservationType_InBoundTx,
BallotThreshold: sdk.MustNewDecFromStr("0.66"),
// #nosec G404 randomness used for testing
BallotStatus: ballotStatus[rand.Intn(max-min)+min], // #nosec G404 randomness used for testing
BallotCreationHeight: 0,
}
Expand Down

0 comments on commit 4d13cc6

Please sign in to comment.