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
+14
View File
@@ -1,6 +1,9 @@
package types
import (
"encoding/json"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
)
@@ -37,3 +40,14 @@ func DefaultGenesisState() GenesisState {
Params: DefaultParams(),
}
}
// GetGenesisStateFromAppState returns x/staking GenesisState given raw application
// genesis state.
func GetGenesisStateFromAppState(cdc *codec.Codec, appState map[string]json.RawMessage) GenesisState {
var genesisState GenesisState
if appState[ModuleName] != nil {
cdc.MustUnmarshalJSON(appState[ModuleName], &genesisState)
}
return genesisState
}