Disable lint for weak RNG usage for test app

Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
Thane Thomson
2022-03-29 18:00:00 -04:00
parent f3d8529faf
commit 7d1f9288f8
+3
View File
@@ -390,6 +390,9 @@ func (app *Application) ExtendVote(req abci.RequestExtendVote) abci.ResponseExte
return abci.ResponseExtendVote{}
}
ext := make([]byte, binary.MaxVarintLen64)
// We don't care that these values are generated by a weak random number
// generator. It's just for test purposes.
// nolint:gosec // G404: Use of weak random number generator
num := rand.Int63n(voteExtensionMaxVal)
extLen := binary.PutVarint(ext, num)
app.logger.Info("generated vote extension", "num", num, "ext", fmt.Sprintf("%x", ext[:extLen]), "state.Height", app.state.Height)