-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
update sims operations to use baseapp #4946
Merged
Merged
Changes from 11 commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
f22313a
update operations to use baseapp
fedekunze 8f1240c
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into fe…
fedekunze 5a31d65
updates and cleanup operations
fedekunze 89cf7b9
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into fe…
fedekunze 5f606ea
update operations
fedekunze d450ebb
restructure sim ops params
fedekunze abb288f
merge master
fedekunze 51bf12b
merge master
fedekunze fe3f6f3
rename sim /operations/msg.go to /operations.go
fedekunze f3a398b
move GenTx to a helper pkg to avoid circle deps
fedekunze 666a301
rm msg.ValidateBasic
fedekunze 1bb0adc
changelog
fedekunze b300de0
random fees; delete auth's DeductFees sim operation
fedekunze bcf6796
add chain-id for sig verification
fedekunze bb47279
Update x/simulation/account.go
fedekunze b52a122
fix bank, gov and distr errors
fedekunze 08af7df
Merge branch 'fedekunze/4935-sim-ops-baseapp' of https://github.com/c…
fedekunze a0a4105
fix staking and slashing errors; increase prob for send enabled
fedekunze 0d33e53
increase gas x10
fedekunze d2d8e06
make format
fedekunze 882b529
fix some distr and staking edge cases
fedekunze 86798bd
fix all edge cases
fedekunze 8a5a8f7
golang ci
fedekunze d2433c8
rename acc vars; default no fees to 0stake
fedekunze 0172569
cleanup; check for exchange rate and skip invalid ops
fedekunze 2a2c369
fixes
fedekunze 50f6959
check for max entries
fedekunze 309348a
add pubkey to genaccounts
fedekunze 4e2d3b3
fix gov bug
fedekunze e662201
update staking sim ops
fedekunze f1c3e12
fix small redelegation error
fedekunze 3298d5d
fix small self delegation on unjail
fedekunze 8501356
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into fe…
fedekunze e615ee1
rm inf loop on random val/accs
fedekunze 9e81756
copy array
fedekunze 490bc77
add ok boolean to RandomValidator return values
fedekunze 2139e75
format
fedekunze 7da6f34
Update x/bank/simulation/operations.go
fedekunze bd7ed37
Update simapp/helpers/test_helpers.go
fedekunze 59620ed
address @colin-axner comments
fedekunze b2b4a63
add genaccount pubkey validation
fedekunze c739839
fix test
fedekunze 8d5a90e
update operations and move RandomFees to x/simulation
fedekunze 52875e5
update gov ops
fedekunze ae94071
merge master
fedekunze c49543f
address @alexanderbez comments
fedekunze 86503a9
avoid modifications to config
fedekunze 496fa15
reorder params
fedekunze 337a25c
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into fe…
fedekunze efcab1d
changelog
fedekunze d4df4bf
Update x/distribution/simulation/genesis.go
fedekunze 4f9961a
merge master
fedekunze 8396254
Merge branch 'fedekunze/4935-sim-ops-baseapp' of https://github.com/c…
fedekunze a188a77
remove named return values
fedekunze ea3594b
ensure all operations are simulated
fedekunze f39fc77
Merge branch 'master' into fedekunze/4935-sim-ops-baseapp
fedekunze c79bc9a
golangci
fedekunze 5491db8
Merge branch 'fedekunze/4935-sim-ops-baseapp' of https://github.com/c…
fedekunze c9faeeb
add nolint
fedekunze b310b12
disable whitespace and funlen linter
fedekunze 446179d
disable godox
fedekunze 42eebc3
add TODO on unjail
fedekunze 272e08a
update ops weights
fedekunze 5a3712d
address @alexanderbez comments
fedekunze c45382b
remove dup
fedekunze efd2edb
update godoc
fedekunze daa8206
Merge branch 'master' into fedekunze/4935-sim-ops-baseapp
fedekunze def149f
x/slashing/simulation/operations.go linting
alexanderbez 57bcfbb
x/staking/simulation/operations.go linting
alexanderbez 5719686
update operations format
fedekunze 0bf30c3
Merge branch 'master' into fedekunze/4935-sim-ops-baseapp
fedekunze 7c3314e
x/bank/simulation/operations.go linting
alexanderbez 4a24fb8
x/distribution/simulation/operations.go linting
alexanderbez a15b55f
x/staking/simulation/operations.go linting
alexanderbez 95f0b04
merge master
fedekunze 42fd548
start changes: make bank simulate send multiple coins, code cleanup
AdityaSripal 0c65eda
fix nondeterminism bug
AdityaSripal cf215f8
fix txsiglimit err
AdityaSripal 99baf18
fix multisend bug
AdityaSripal 33ee0e0
simplify simulation, cleanup opt privkey args
AdityaSripal bc1027d
make slashing test invalid unjail msgs
AdityaSripal 202fe2b
Merge branch 'master' into fedekunze/4935-sim-ops-baseapp
alexanderbez 716d00d
Update simapp/state.go
alexanderbez 6ed2005
golangCI changes
fedekunze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package helpers | ||
|
||
import ( | ||
"math/rand" | ||
|
||
"github.com/tendermint/tendermint/crypto" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/x/auth" | ||
"github.com/cosmos/cosmos-sdk/x/simulation" | ||
) | ||
|
||
// GenTx generates a signed mock transaction. | ||
func GenTx(msgs []sdk.Msg, accnums []uint64, seq []uint64, priv ...crypto.PrivKey) auth.StdTx { | ||
// Make the transaction free | ||
fee := auth.StdFee{ | ||
Amount: sdk.NewCoins(sdk.NewInt64Coin("foocoin", 0)), // TODO: this should be the default bond denom | ||
Gas: 100000, | ||
} | ||
|
||
sigs := make([]auth.StdSignature, len(priv)) | ||
|
||
// create a random length memo | ||
seed := rand.Int63() | ||
r := rand.New(rand.NewSource(seed)) | ||
fedekunze marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
memo := simulation.RandStringOfLength(r, simulation.RandIntBetween(r, 0, 140)) | ||
|
||
for i, p := range priv { | ||
// use a empty chainID for ease of testing | ||
sig, err := p.Sign(auth.StdSignBytes("", accnums[i], seq[i], fee, msgs, memo)) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
sigs[i] = auth.StdSignature{ | ||
PubKey: p.PubKey(), | ||
Signature: sig, | ||
} | ||
} | ||
|
||
return auth.NewStdTx(msgs, fee, sigs, memo) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally, we should move all the contents from
simapp/test_helpers.go
to this file and update the keepers that use it, although that's out of scope from this PR. cc: @colin-axner