-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem: sim tests are removed #304
Conversation
/runsim |
import ( | ||
"encoding/json" | ||
"fmt" | ||
"math/rand" |
Check warning
Code scanning / Semgrep
Do not use `math/rand`. Use `crypto/rand` instead.
"encoding/json" | ||
"fmt" | ||
"math/big" | ||
"math/rand" |
Check warning
Code scanning / Semgrep
Do not use `math/rand`. Use `crypto/rand` instead.
go-version: 1.19 | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- uses: technote-space/get-diff-action@v6.1.1 |
Check warning
Code scanning / Semgrep
Semgrep Finding: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha
go-version: 1.19 | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- uses: technote-space/get-diff-action@v6.1.1 |
Check warning
Code scanning / Semgrep
Semgrep Finding: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha
go-version: 1.19 | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- uses: technote-space/get-diff-action@v6.1.1 |
Check warning
Code scanning / Semgrep
Semgrep Finding: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha
go-version: 1.19 | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- uses: technote-space/get-diff-action@v6.1.1 |
Check warning
Code scanning / Semgrep
Semgrep Finding: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha
// Transferable amount is between the range [0, spendable), spendable = balance - gasFeeCap * GasLimit. | ||
func RandomTransferableAmount(ctx *simulateContext, address common.Address, estimateGas uint64, gasFeeCap *big.Int) (amount *big.Int, err error) { | ||
balance := ctx.keeper.GetBalance(ctx.context, address) | ||
feeLimit := new(big.Int).Mul(gasFeeCap, big.NewInt(int64(estimateGas))) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
return nil, err | ||
} | ||
// we suppose that gasLimit should be larger than estimateGas to ensure tx validity | ||
gasLimit := estimateGas + uint64(ctx.rand.Intn(int(sdktx.MaxGasWanted-estimateGas))) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
return nil, err | ||
} | ||
// we suppose that gasLimit should be larger than estimateGas to ensure tx validity | ||
gasLimit := estimateGas + uint64(ctx.rand.Intn(int(sdktx.MaxGasWanted-estimateGas))) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
|
||
prv := secp256k1.GenPrivKeyFromSecret(privkeySeed) | ||
ethPrv := ðsecp256k1.PrivKey{} | ||
_ = ethPrv.UnmarshalAmino(prv.Bytes()) // UnmarshalAmino simply copies the bytes and assigns them to ethPrv.Key |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack.
for i := 0; i < n; i++ { | ||
// don't need that much entropy for simulation | ||
privkeySeed := make([]byte, 15) | ||
_, _ = r.Read(privkeySeed) |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack.
Closes: #XXX
Description
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)