Skip to content

Commit 2530987

Browse files
authored
refactor(x/mint): remove unused parameter from AfterDistributeMintedCoin (#2390)
* refactor(x/mint): remove unused parameter from AfterDistributeMintedCoin * remove param from mint hook mock * changelog
1 parent a402a9d commit 2530987

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7272
* [#1667](https://github.com/osmosis-labs/osmosis/pull/1673) Move wasm-bindings code out of app package into its own root level package.
7373
* [#2013](https://github.com/osmosis-labs/osmosis/pull/2013) Make `SetParams`, `SetPool`, `SetTotalLiquidity`, and `SetDenomLiquidity` GAMM APIs private
7474
* [#1857](https://github.com/osmosis-labs/osmosis/pull/1857) x/mint rename GetLastHalvenEpochNum to GetLastReductionEpochNum
75+
* [#2390](https://github.com/osmosis-labs/osmosis/pull/2390) x/mint remove unused mintCoins parameter from AfterDistributeMintedCoin
7576

7677
### Features
7778

x/mint/keeper/keeper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (k Keeper) DistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) error
229229
}
230230

231231
// call an hook after the minting and distribution of new coins
232-
k.hooks.AfterDistributeMintedCoin(ctx, mintedCoin)
232+
k.hooks.AfterDistributeMintedCoin(ctx)
233233

234234
return err
235235
}

x/mint/keeper/keeper_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type mintHooksMock struct {
2929
hookCallCount int
3030
}
3131

32-
func (hm *mintHooksMock) AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) {
32+
func (hm *mintHooksMock) AfterDistributeMintedCoin(ctx sdk.Context) {
3333
hm.hookCallCount++
3434
}
3535

x/mint/types/hooks.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
// MintHooks defines an interface for mint module's hooks.
88
type MintHooks interface {
9-
AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin)
9+
AfterDistributeMintedCoin(ctx sdk.Context)
1010
}
1111

1212
var _ MintHooks = MultiMintHooks{}
@@ -22,8 +22,8 @@ func NewMultiMintHooks(hooks ...MintHooks) MultiMintHooks {
2222

2323
// AfterDistributeMintedCoin is a hook that runs after minter mints and distributes coins
2424
// at the beginning of each epoch.
25-
func (h MultiMintHooks) AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) {
25+
func (h MultiMintHooks) AfterDistributeMintedCoin(ctx sdk.Context) {
2626
for i := range h {
27-
h[i].AfterDistributeMintedCoin(ctx, mintedCoin)
27+
h[i].AfterDistributeMintedCoin(ctx)
2828
}
2929
}

x/pool-incentives/keeper/hooks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (h Hooks) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64,
4040
}
4141

4242
// Distribute coins after minter module allocate assets to pool-incentives module.
43-
func (h Hooks) AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) {
43+
func (h Hooks) AfterDistributeMintedCoin(ctx sdk.Context) {
4444
// @Sunny, @Tony, @Dev, what comments should we keep after modifying own BeginBlocker to hooks?
4545

4646
// WARNING: The order of how modules interact with the default distribution module matters if the distribution module is used in a similar way to:

0 commit comments

Comments
 (0)