@@ -21,6 +21,7 @@ import (
21
21
abci "github.com/tendermint/tendermint/abci/types"
22
22
"github.com/tendermint/tendermint/libs/log"
23
23
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
24
+ "github.com/tendermint/tendermint/proto/tendermint/version"
24
25
tmtypes "github.com/tendermint/tendermint/types"
25
26
dbm "github.com/tendermint/tm-db"
26
27
@@ -61,6 +62,10 @@ func SetupTestingApp() (TestingApp, map[string]json.RawMessage) {
61
62
// of one consensus engine unit (10^6) in the default token of the simapp from first genesis
62
63
// account. A Nop logger is set in SimApp.
63
64
func SetupWithGenesisValSet (t * testing.T , valSet * tmtypes.ValidatorSet , genAccs []authtypes.GenesisAccount , chainID string , powerReduction math.Int , balances ... banktypes.Balance ) TestingApp {
65
+ return SetupWithGenesisValSetAndConsensusParams (t , simapp .DefaultConsensusParams , valSet , genAccs , chainID , powerReduction , balances ... )
66
+ }
67
+
68
+ func SetupWithGenesisValSetAndConsensusParams (t * testing.T , consensusParams * abci.ConsensusParams , valSet * tmtypes.ValidatorSet , genAccs []authtypes.GenesisAccount , chainID string , powerReduction math.Int , balances ... banktypes.Balance ) TestingApp {
64
69
app , genesisState := DefaultTestingAppInit ()
65
70
66
71
// set genesis accounts
@@ -123,7 +128,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs
123
128
abci.RequestInitChain {
124
129
ChainId : chainID ,
125
130
Validators : []abci.ValidatorUpdate {},
126
- ConsensusParams : simapp . DefaultConsensusParams ,
131
+ ConsensusParams : consensusParams ,
127
132
AppStateBytes : stateBytes ,
128
133
},
129
134
)
@@ -133,6 +138,9 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs
133
138
app .BeginBlock (
134
139
abci.RequestBeginBlock {
135
140
Header : tmproto.Header {
141
+ Version : version.Consensus {
142
+ App : consensusParams .Version .AppVersion ,
143
+ },
136
144
ChainID : chainID ,
137
145
Height : app .LastBlockHeight () + 1 ,
138
146
AppHash : app .LastCommitID ().Hash ,
0 commit comments