-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4582422
commit 1049158
Showing
6 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package keeper | ||
|
||
import ( | ||
"cosmossdk.io/math" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
stablestaketypes "github.com/elys-network/elys/x/stablestake/types" | ||
) | ||
|
||
func (k Keeper) AfterUpdateInterestStacked(ctx sdk.Context, address string, old sdk.Int, new sdk.Int) error { | ||
k.SetSortedLiquidation(ctx, address, old, new) | ||
return nil | ||
} | ||
|
||
// Hooks wrapper struct for incentive keeper | ||
type StableStakeHooks struct { | ||
k Keeper | ||
} | ||
|
||
var _ stablestaketypes.StableStakeHooks = StableStakeHooks{} | ||
|
||
// Return the wrapper struct | ||
func (k Keeper) StableStakeHooks() StableStakeHooks { | ||
return StableStakeHooks{k} | ||
} | ||
|
||
func (h StableStakeHooks) AfterBond(ctx sdk.Context, sender string, shareAmount math.Int) error { | ||
return nil | ||
} | ||
|
||
func (h StableStakeHooks) AfterUnbond(ctx sdk.Context, sender string, shareAmount math.Int) error { | ||
return nil | ||
} | ||
|
||
func (h StableStakeHooks) AfterUpdateInterestStacked(ctx sdk.Context, address string, old sdk.Int, new sdk.Int) error { | ||
h.k.AfterUpdateInterestStacked(ctx, address, old, new) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters