From c52dda57074e415bf38a31c89f4dd2ef3d5d9e18 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 12 Aug 2022 18:28:43 -0400 Subject: [PATCH 1/3] refactor(x/mint): remove unused parameter from AfterDistributeMintedCoin --- x/mint/keeper/keeper.go | 2 +- x/mint/types/hooks.go | 6 +++--- x/pool-incentives/keeper/hooks.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x/mint/keeper/keeper.go b/x/mint/keeper/keeper.go index c407e328341..949c440f892 100644 --- a/x/mint/keeper/keeper.go +++ b/x/mint/keeper/keeper.go @@ -229,7 +229,7 @@ func (k Keeper) DistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) error } // call an hook after the minting and distribution of new coins - k.hooks.AfterDistributeMintedCoin(ctx, mintedCoin) + k.hooks.AfterDistributeMintedCoin(ctx) return err } diff --git a/x/mint/types/hooks.go b/x/mint/types/hooks.go index 1cffa07ccd4..e304d4e0029 100644 --- a/x/mint/types/hooks.go +++ b/x/mint/types/hooks.go @@ -6,7 +6,7 @@ import ( // MintHooks defines an interface for mint module's hooks. type MintHooks interface { - AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) + AfterDistributeMintedCoin(ctx sdk.Context) } var _ MintHooks = MultiMintHooks{} @@ -22,8 +22,8 @@ func NewMultiMintHooks(hooks ...MintHooks) MultiMintHooks { // AfterDistributeMintedCoin is a hook that runs after minter mints and distributes coins // at the beginning of each epoch. -func (h MultiMintHooks) AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) { +func (h MultiMintHooks) AfterDistributeMintedCoin(ctx sdk.Context) { for i := range h { - h[i].AfterDistributeMintedCoin(ctx, mintedCoin) + h[i].AfterDistributeMintedCoin(ctx) } } diff --git a/x/pool-incentives/keeper/hooks.go b/x/pool-incentives/keeper/hooks.go index c2b49cdf488..a40290c3a7b 100644 --- a/x/pool-incentives/keeper/hooks.go +++ b/x/pool-incentives/keeper/hooks.go @@ -40,7 +40,7 @@ func (h Hooks) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, } // Distribute coins after minter module allocate assets to pool-incentives module. -func (h Hooks) AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) { +func (h Hooks) AfterDistributeMintedCoin(ctx sdk.Context) { // @Sunny, @Tony, @Dev, what comments should we keep after modifying own BeginBlocker to hooks? // WARNING: The order of how modules interact with the default distribution module matters if the distribution module is used in a similar way to: From 532b3dca0a28a1c038693a90d21b0b5fa3c24bdb Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 12 Aug 2022 20:50:36 -0400 Subject: [PATCH 2/3] remove param from mint hook mock --- x/mint/keeper/keeper_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/mint/keeper/keeper_test.go b/x/mint/keeper/keeper_test.go index 50557b2ce56..c478a18ac19 100644 --- a/x/mint/keeper/keeper_test.go +++ b/x/mint/keeper/keeper_test.go @@ -29,7 +29,7 @@ type mintHooksMock struct { hookCallCount int } -func (hm *mintHooksMock) AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) { +func (hm *mintHooksMock) AfterDistributeMintedCoin(ctx sdk.Context) { hm.hookCallCount++ } From 1dcde56e3405b6063a51502ef754a83651386c5e Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 12 Aug 2022 20:52:12 -0400 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee50b747c3d..b6674a6b80b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1667](https://github.com/osmosis-labs/osmosis/pull/1673) Move wasm-bindings code out of app package into its own root level package. * [#2013](https://github.com/osmosis-labs/osmosis/pull/2013) Make `SetParams`, `SetPool`, `SetTotalLiquidity`, and `SetDenomLiquidity` GAMM APIs private * [#1857](https://github.com/osmosis-labs/osmosis/pull/1857) x/mint rename GetLastHalvenEpochNum to GetLastReductionEpochNum +* [#2390](https://github.com/osmosis-labs/osmosis/pull/2390) x/mint remove unused mintCoins parameter from AfterDistributeMintedCoin ### Features