mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-27 00:35:18 +00:00
18 lines
498 B
Go
18 lines
498 B
Go
|
package swap
|
||
|
|
||
|
import (
|
||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||
|
)
|
||
|
|
||
|
// NewHandler creates an sdk.Handler for swap messages
|
||
|
func NewHandler(k Keeper) sdk.Handler {
|
||
|
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
|
||
|
ctx = ctx.WithEventManager(sdk.NewEventManager())
|
||
|
switch msg := msg.(type) {
|
||
|
default:
|
||
|
return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", ModuleName, msg)
|
||
|
}
|
||
|
}
|
||
|
}
|