Skip to content

Commit bd41740

Browse files
mergify[bot]p0mvn
andauthored
refactor(x/mint): remove unused parameter from AfterDistributeMintedCoin (backport #2390) (#2396)
Co-authored-by: Roman <ackhtariev@gmail.com>
1 parent f012c56 commit bd41740

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4545
#### Golang API breaks
4646

4747
* [#1893](https://github.com/osmosis-labs/osmosis/pull/1893) Change `EpochsKeeper.SetEpochInfo` to `AddEpochInfo`, which has more safety checks with it. (Makes it suitable to be called within upgrades)
48+
* [#2396](https://github.com/osmosis-labs/osmosis/pull/2396) x/mint remove unused mintCoins parameter from AfterDistributeMintedCoin
4849

4950
#### Bug Fixes
5051
* [2291](https://github.com/osmosis-labs/osmosis/pull/2291) Remove liquidity event that was emitted twice per message.

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: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
)
66

77
type MintHooks interface {
8-
AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin)
8+
AfterDistributeMintedCoin(ctx sdk.Context)
99
}
1010

1111
var _ MintHooks = MultiMintHooks{}
@@ -17,8 +17,10 @@ func NewMultiMintHooks(hooks ...MintHooks) MultiMintHooks {
1717
return hooks
1818
}
1919

20-
func (h MultiMintHooks) AfterDistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) {
20+
// AfterDistributeMintedCoin is a hook that runs after minter mints and distributes coins
21+
// at the beginning of each epoch.
22+
func (h MultiMintHooks) AfterDistributeMintedCoin(ctx sdk.Context) {
2123
for i := range h {
22-
h[i].AfterDistributeMintedCoin(ctx, mintedCoin)
24+
h[i].AfterDistributeMintedCoin(ctx)
2325
}
2426
}

x/pool-incentives/keeper/hooks.go

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

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

4242
// 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)