mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 18:15:19 +00:00
34 lines
808 B
Go
34 lines
808 B
Go
package paychan
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"reflect"
|
|
)
|
|
|
|
// NewHandler returns a handler for "paychan" type messages.
|
|
func NewHandler(k Keeper) sdk.Handler {
|
|
return func(ctx sdk.Context, msg sdk.Msg) sdk.Result {
|
|
switch msg := msg.(type) {
|
|
case MsgSend:
|
|
return handleMsgSend(ctx, k, msg)
|
|
case MsgIssue:
|
|
return handleMsgIssue(ctx, k, msg)
|
|
default:
|
|
errMsg := "Unrecognized paychan Msg type: " + reflect.TypeOf(msg).Name()
|
|
return sdk.ErrUnknownRequest(errMsg).Result()
|
|
}
|
|
}
|
|
}
|
|
|
|
// Handle CreateMsg.
|
|
func handleMsgCreate(ctx sdk.Context, k Keeper, msg MsgSend) sdk.Result {
|
|
// k.CreatePaychan(args...)
|
|
// handle erros
|
|
}
|
|
|
|
// Handle CloseMsg.
|
|
func handleMsgClose(ctx sdk.Context, k Keeper, msg MsgIssue) sdk.Result {
|
|
// k.ClosePaychan(args...)
|
|
// handle errors
|
|
}
|