Add consensus params into Simulation (#6002)

* temporal commit

* add random consensus params

* make format

* make random pass

* remove comment

* revert change

* update ub key types

* extract Evidence params from state

* extract the random parameters from state

* clean the code

* update imports!

* mispelled back

* mispelled back

* add misspelled command

* update changelog

* remove useless linter to avoid misspell

* remove function

* use tendermint constants

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
This commit is contained in:
Jonathan Gimeno
2020-04-21 18:28:43 +00:00
committed by GitHub
co-authored by Alexander Bezobchuk
parent 71c62a432f
commit 65048683b5
6 changed files with 67 additions and 8 deletions
+8 -3
View File
@@ -17,6 +17,8 @@ import (
"github.com/cosmos/cosmos-sdk/types/simulation"
)
const AverageBlockTime = 6 * time.Second
// initialize the chain for the simulation
func initChain(
r *rand.Rand, params Params, accounts []simulation.Account, app *baseapp.BaseApp,
@@ -25,9 +27,12 @@ func initChain(
appState, accounts, chainID, genesisTimestamp := appStateFn(r, accounts, config)
consensusParams := RandomConsensusParams(r, appState)
req := abci.RequestInitChain{
AppStateBytes: appState,
ChainId: chainID,
AppStateBytes: appState,
ChainId: chainID,
ConsensusParams: consensusParams,
}
res := app.InitChain(req)
validators := newMockValidators(r, res.Validators, params)
@@ -108,7 +113,7 @@ func SimulateFromSeed(
// These are operations which have been queued by previous operations
operationQueue := NewOperationQueue()
timeOperationQueue := []simulation.FutureOperation{}
var timeOperationQueue []simulation.FutureOperation
logWriter := NewLogWriter(testingMode)