diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index a80138551a..0fd86f3c1c 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -273,6 +273,7 @@ func TestProviderStateIsCleanedAfterConsumerChainIsStopped(t *testing.T, ctx sdk require.Empty(t, providerKeeper.GetAllValidatorsByConsumerAddr(ctx, &expectedChainID)) require.Empty(t, providerKeeper.GetAllConsumerAddrsToPrune(ctx, expectedChainID)) require.Empty(t, providerKeeper.GetAllCommissionRateValidators(ctx, expectedChainID)) + require.Zero(t, providerKeeper.GetEquivocationEvidenceMinHeight(ctx, expectedChainID)) } func GetTestConsumerAdditionProp() *providertypes.ConsumerAdditionProposal { diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 4b6cf9bad3..edc705aafa 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -394,6 +394,8 @@ func TestStopConsumerChain(t *testing.T) { expErr bool } + consumerCID := "chainID" + tests := []testCase{ { description: "proposal dropped, client doesn't exist", @@ -407,6 +409,9 @@ func TestStopConsumerChain(t *testing.T) { setup: func(ctx sdk.Context, providerKeeper *providerkeeper.Keeper, mocks testkeeper.MockedKeepers) { testkeeper.SetupForStoppingConsumerChain(t, ctx, providerKeeper, mocks) + // set consumer min height + providerKeeper.SetEquivocationEvidenceMinHeight(ctx, consumerCID, 1) + // assert mocks for expected calls to `StopConsumerChain` when closing the underlying channel gomock.InOrder(testkeeper.GetMocksForStopConsumerChainWithCloseChannel(ctx, &mocks)...) }, @@ -424,7 +429,7 @@ func TestStopConsumerChain(t *testing.T) { // Setup specific to test case tc.setup(ctx, &providerKeeper, mocks) - err := providerKeeper.StopConsumerChain(ctx, "chainID", true) + err := providerKeeper.StopConsumerChain(ctx, consumerCID, true) if tc.expErr { require.Error(t, err) @@ -432,7 +437,7 @@ func TestStopConsumerChain(t *testing.T) { require.NoError(t, err) } - testkeeper.TestProviderStateIsCleanedAfterConsumerChainIsStopped(t, ctx, providerKeeper, "chainID", "channelID") + testkeeper.TestProviderStateIsCleanedAfterConsumerChainIsStopped(t, ctx, providerKeeper, consumerCID, "channelID") ctrl.Finish() }