0g-chain/x/swap/keeper/hooks.go
drklee3 3375484f79
Update deprecated Cosmos methods (#1530)
* Use cosmossdk.io/errors for deprecated error methods

* Update error registration with cosmossdk.io/errors

* Use cosmossdk.io/math for deprecated sdk.Int alias

* Fix modified proto file

* Update sdk.Int usage in swap hooks

* Update e2e test deprecated method usage
2023-04-05 16:21:59 -07:00

26 lines
767 B
Go

package keeper
import (
sdkmath "cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/kava-labs/kava/x/swap/types"
)
// Implements SwapHooks interface
var _ types.SwapHooks = Keeper{}
// AfterPoolDepositCreated - call hook if registered
func (k Keeper) AfterPoolDepositCreated(ctx sdk.Context, poolID string, depositor sdk.AccAddress, sharesOwned sdkmath.Int) {
if k.hooks != nil {
k.hooks.AfterPoolDepositCreated(ctx, poolID, depositor, sharesOwned)
}
}
// BeforePoolDepositModified - call hook if registered
func (k Keeper) BeforePoolDepositModified(ctx sdk.Context, poolID string, depositor sdk.AccAddress, sharesOwned sdkmath.Int) {
if k.hooks != nil {
k.hooks.BeforePoolDepositModified(ctx, poolID, depositor, sharesOwned)
}
}