Fix all unit tests

This commit is contained in:
Sergio Mena
2022-11-30 02:24:54 +01:00
parent 33e022c0c7
commit 3a2a02f299
2 changed files with 13 additions and 13 deletions

View File

@@ -545,7 +545,7 @@ func updateState(
nextParams := state.ConsensusParams
lastHeightParamsChanged := state.LastHeightConsensusParamsChanged
if abciResponse.ConsensusParamUpdates != nil {
// NOTE: must not mutate s.ConsensusParams
// NOTE: must not mutate state.ConsensusParams
nextParams = state.ConsensusParams.Update(abciResponse.ConsensusParamUpdates)
err := nextParams.ValidateBasic()
if err != nil {

View File

@@ -154,8 +154,8 @@ func TestConsensusParamsUpdate_AppVersion(t *testing.T) {
func TestConsensusParamsUpdate_VoteExtensionsEnableHeight(t *testing.T) {
t.Run("set to height but initial height already run", func(*testing.T) {
initialParams := makeParams(1, 0, 2, 0, valEd25519, 1)
update := &ConsensusParams{
ABCI: ABCIParams{
update := &tmproto.ConsensusParams{
Abci: &tmproto.ABCIParams{
VoteExtensionsEnableHeight: 10,
},
}
@@ -164,8 +164,8 @@ func TestConsensusParamsUpdate_VoteExtensionsEnableHeight(t *testing.T) {
})
t.Run("reset to 0", func(t *testing.T) {
initialParams := makeParams(1, 0, 2, 0, valEd25519, 1)
update := &ConsensusParams{
ABCI: ABCIParams{
update := &tmproto.ConsensusParams{
Abci: &tmproto.ABCIParams{
VoteExtensionsEnableHeight: 0,
},
}
@@ -173,8 +173,8 @@ func TestConsensusParamsUpdate_VoteExtensionsEnableHeight(t *testing.T) {
})
t.Run("set to height before current height run", func(*testing.T) {
initialParams := makeParams(1, 0, 2, 0, valEd25519, 100)
update := &ConsensusParams{
ABCI: ABCIParams{
update := &tmproto.ConsensusParams{
Abci: &tmproto.ABCIParams{
VoteExtensionsEnableHeight: 10,
},
}
@@ -183,8 +183,8 @@ func TestConsensusParamsUpdate_VoteExtensionsEnableHeight(t *testing.T) {
})
t.Run("set to height after current height run", func(*testing.T) {
initialParams := makeParams(1, 0, 2, 0, valEd25519, 300)
update := &ConsensusParams{
ABCI: ABCIParams{
update := &tmproto.ConsensusParams{
Abci: &tmproto.ABCIParams{
VoteExtensionsEnableHeight: 99,
},
}
@@ -193,8 +193,8 @@ func TestConsensusParamsUpdate_VoteExtensionsEnableHeight(t *testing.T) {
})
t.Run("no error when unchanged", func(*testing.T) {
initialParams := makeParams(1, 0, 2, 0, valEd25519, 100)
update := &ConsensusParams{
ABCI: ABCIParams{
update := &tmproto.ConsensusParams{
Abci: &tmproto.ABCIParams{
VoteExtensionsEnableHeight: 100,
},
}
@@ -202,8 +202,8 @@ func TestConsensusParamsUpdate_VoteExtensionsEnableHeight(t *testing.T) {
})
t.Run("updated from 0 to 0", func(t *testing.T) {
initialParams := makeParams(1, 0, 2, 0, valEd25519, 0)
update := &ConsensusParams{
ABCI: ABCIParams{
update := &tmproto.ConsensusParams{
Abci: &tmproto.ABCIParams{
VoteExtensionsEnableHeight: 0,
},
}