diff --git a/x/distribution/README.md b/x/distribution/README.md index bd7153218291..6b5416e46449 100644 --- a/x/distribution/README.md +++ b/x/distribution/README.md @@ -352,13 +352,20 @@ The transaction fails if the amount cannot be transferred from the sender to the ```go func (k Keeper) FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error { - if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, amount); err != nil { - return err - } + if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, amount); err != nil { + return err + } + + feePool, err := k.FeePool.Get(ctx) + if err != nil { + return err + } - feePool := k.GetFeePool(ctx) feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinsFromCoins(amount...)...) - k.SetFeePool(ctx, feePool) + + if err := k.FeePool.Set(ctx, feePool); err != nil { + return err + } return nil } diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 1a7c78d61df6..0dc0ac0b6365 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -1,7 +1,7 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/gov/testutil/expected_keepers.go -// Package mock_testutil is a generated GoMock package. +// Package testutil is a generated GoMock package. package testutil import ( diff --git a/x/staking/testutil/expected_keepers_mocks.go b/x/staking/testutil/expected_keepers_mocks.go index e66027edd2e7..83b680522412 100644 --- a/x/staking/testutil/expected_keepers_mocks.go +++ b/x/staking/testutil/expected_keepers_mocks.go @@ -38,20 +38,6 @@ func (m *MockDistributionKeeper) EXPECT() *MockDistributionKeeperMockRecorder { return m.recorder } -// GetFeePoolCommunityCoins mocks base method. -func (m *MockDistributionKeeper) GetFeePoolCommunityCoins(ctx context.Context) types.DecCoins { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetFeePoolCommunityCoins", ctx) - ret0, _ := ret[0].(types.DecCoins) - return ret0 -} - -// GetFeePoolCommunityCoins indicates an expected call of GetFeePoolCommunityCoins. -func (mr *MockDistributionKeeperMockRecorder) GetFeePoolCommunityCoins(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeePoolCommunityCoins", reflect.TypeOf((*MockDistributionKeeper)(nil).GetFeePoolCommunityCoins), ctx) -} - // GetValidatorOutstandingRewardsCoins mocks base method. func (m *MockDistributionKeeper) GetValidatorOutstandingRewardsCoins(ctx context.Context, val types.ValAddress) types.DecCoins { m.ctrl.T.Helper() diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index 9ab221103179..9761500baca5 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -11,7 +11,6 @@ import ( // DistributionKeeper expected distribution keeper (noalias) type DistributionKeeper interface { - GetFeePoolCommunityCoins(ctx context.Context) sdk.DecCoins GetValidatorOutstandingRewardsCoins(ctx context.Context, val sdk.ValAddress) sdk.DecCoins }