From 3a2a02f299f8eef7b9fd242d808ff9176ec08901 Mon Sep 17 00:00:00 2001 From: Sergio Mena Date: Wed, 30 Nov 2022 02:24:54 +0100 Subject: [PATCH] Fix all unit tests --- state/execution.go | 2 +- types/params_test.go | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/state/execution.go b/state/execution.go index d9f68615d..4d3310724 100644 --- a/state/execution.go +++ b/state/execution.go @@ -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 { diff --git a/types/params_test.go b/types/params_test.go index 597c9ae40..c07c56cc3 100644 --- a/types/params_test.go +++ b/types/params_test.go @@ -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, }, }