/
hooks_commitment.go
39 lines (30 loc) · 1.15 KB
/
hooks_commitment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
commitmenttypes "github.com/elys-network/elys/x/commitment/types"
)
// Process commitmentChanged hook
func (k Keeper) CommitmentChanged(ctx sdk.Context, creator string, amount sdk.Coins) {
}
// Process eden uncommitted hook
func (k Keeper) EdenUncommitted(ctx sdk.Context, creator string, amount sdk.Coin) {
k.BurnEdenBFromEdenUncommitted(ctx, creator, amount.Amount)
}
// ___________________________________________________________________________________________________
// Hooks wrapper struct for incentive keeper
type CommitmentHooks struct {
k Keeper
}
var _ commitmenttypes.CommitmentHooks = CommitmentHooks{}
// Return the wrapper struct
func (k Keeper) CommitmentHooks() CommitmentHooks {
return CommitmentHooks{k}
}
// CommitmentChanged implements CommentmentHook
func (h CommitmentHooks) CommitmentChanged(ctx sdk.Context, creator string, amount sdk.Coins) {
h.k.CommitmentChanged(ctx, creator, amount)
}
// EdenUncommitted implements EdenUncommitted
func (h CommitmentHooks) EdenUncommitted(ctx sdk.Context, creator string, amount sdk.Coin) {
h.k.EdenUncommitted(ctx, creator, amount)
}