forked from crypto-com/chain-indexing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_msg_begin_redelegate.go
37 lines (31 loc) · 1.15 KB
/
create_msg_begin_redelegate.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
package command
import (
entity_event "github.com/WilliamXieCrypto/chain-indexing/entity/event"
"github.com/WilliamXieCrypto/chain-indexing/usecase/event"
"github.com/WilliamXieCrypto/chain-indexing/usecase/model"
)
// CreateMsgBeginRedelegate is a command to create MsgBeginRedelegate event
type CreateMsgBeginRedelegate struct {
msgCommonParams event.MsgCommonParams
params model.MsgBeginRedelegateParams
}
// NewCreateMsgBeginRedelegate create a new instance of CreateMsgBeginRedelegate command
func NewCreateMsgBeginRedelegate(msgCommonParams event.MsgCommonParams, params model.MsgBeginRedelegateParams) *CreateMsgBeginRedelegate {
return &CreateMsgBeginRedelegate{
msgCommonParams,
params,
}
}
// Name returns name of command
func (*CreateMsgBeginRedelegate) Name() string {
return "CreateMsgBeginRedelegate"
}
// Version returns version of command
func (*CreateMsgBeginRedelegate) Version() int {
return 1
}
// Exec process the command data and return the event accordingly
func (cmd *CreateMsgBeginRedelegate) Exec() (entity_event.Event, error) {
event := event.NewMsgBeginRedelegate(cmd.msgCommonParams, cmd.params)
return event, nil
}