From 544331ee9625649a5c6eff9b9b717111cfbfc87c Mon Sep 17 00:00:00 2001 From: stana-ethernal Date: Tue, 26 Nov 2024 13:37:48 +0100 Subject: [PATCH] comment fix --- testutil/keeper/expectations.go | 2 +- x/ccv/provider/keeper/infraction_parameters.go | 4 ++-- x/ccv/provider/keeper/relay_test.go | 12 +++--------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/testutil/keeper/expectations.go b/testutil/keeper/expectations.go index d5bf6ac9ea..52221cf283 100644 --- a/testutil/keeper/expectations.go +++ b/testutil/keeper/expectations.go @@ -91,7 +91,7 @@ func GetMocksForDeleteConsumerChain(ctx sdk.Context, mocks *MockedKeepers) []*go func GetMocksForHandleSlashPacket(ctx sdk.Context, mocks MockedKeepers, expectedProviderValConsAddr providertypes.ProviderConsAddress, - valToReturn stakingtypes.Validator, expectJailing bool, valAddr []byte, + valToReturn stakingtypes.Validator, expectJailing bool, ) []*gomock.Call { // These first two calls are always made. calls := []*gomock.Call{ diff --git a/x/ccv/provider/keeper/infraction_parameters.go b/x/ccv/provider/keeper/infraction_parameters.go index 5dd63f3849..8abf21a5b6 100644 --- a/x/ccv/provider/keeper/infraction_parameters.go +++ b/x/ccv/provider/keeper/infraction_parameters.go @@ -162,8 +162,8 @@ func (k Keeper) RemoveConsumerInfractionQueuedData(ctx sdk.Context, consumerId s // UpdateQueuedInfractionParams updates the infraction parameters in the time queue. // Parameters for the specific consumer already exist in the queue: -// - If the new parameters are the same as the current queued parameters, the existing entry is removed to cancel the update. -// - If the new parameters are different, the existing entry is removed and new entry is added to the queue to schedule the update. +// - If the new parameters are the same as the current infraction parameters, the existing queued entry is removed to cancel the update. +// - If the new parameters are different from both queued and current parameters, the existing entry is removed and new entry is added to the queue to schedule the update. // // Parameters for the specific consumer do not exist in the update queue and the new parameters differ from the consumer current infraction parameters, // a new entry is added to the queue to schedule the update. diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index 45d0b7e4fc..5f31bc3a43 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -6,7 +6,6 @@ import ( "testing" "time" - authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" @@ -208,8 +207,6 @@ func TestOnRecvDowntimeSlashPacket(t *testing.T) { // Mock call to GetEffectiveValPower, so that it returns 2. providerAddr := providertypes.NewProviderConsAddress(packetData.Validator.Address) valAddr := sdk.ValAddress(packetData.Validator.Address).String() - valOper, err := providerKeeper.ValidatorAddressCodec().StringToBytes(valAddr) - require.NoError(t, err) calls := []*gomock.Call{ mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, providerAddr.ToSdkConsAddr()). Return(stakingtypes.Validator{ @@ -224,7 +221,7 @@ func TestOnRecvDowntimeSlashPacket(t *testing.T) { // Add mocks for slash packet handling calls = append(calls, testkeeper.GetMocksForHandleSlashPacket( - ctx, mocks, providerAddr, stakingtypes.Validator{Jailed: false, OperatorAddress: valAddr}, true, valOper)..., + ctx, mocks, providerAddr, stakingtypes.Validator{Jailed: false, OperatorAddress: valAddr}, true)..., ) gomock.InOrder(calls...) @@ -354,9 +351,6 @@ func TestHandleSlashPacket(t *testing.T) { consumerConsAddr := cryptotestutil.NewCryptoIdentityFromIntSeed(784987634).ConsumerConsAddress() valOperAddr := cryptotestutil.NewCryptoIdentityFromIntSeed(7842334).SDKValOpAddressString() - valAddrCodec := authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()) - valOperAddrBytes, err := valAddrCodec.StringToBytes(valOperAddr) - require.NoError(t, err) testCases := []struct { name string @@ -449,7 +443,7 @@ func TestHandleSlashPacket(t *testing.T) { providerConsAddr, // expected provider cons addr returned from GetProviderAddrFromConsumerAddr stakingtypes.Validator{Jailed: false, OperatorAddress: valOperAddr}, // staking keeper val to return true, // expectJailing = true - valOperAddrBytes) + ) }, 1, consumerConsAddr, @@ -468,7 +462,7 @@ func TestHandleSlashPacket(t *testing.T) { providerConsAddr, // expected provider cons addr returned from GetProviderAddrFromConsumerAddr stakingtypes.Validator{Jailed: true, OperatorAddress: valOperAddr}, // staking keeper val to return false, // expectJailing = false, validator is already jailed. - valOperAddrBytes) + ) }, 1, consumerConsAddr,