forked from crypto-com/chain-indexing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_msg_deposit.go
38 lines (32 loc) · 927 Bytes
/
create_msg_deposit.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
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"
)
type CreateMsgDeposit struct {
msgCommonParams event.MsgCommonParams
params model.MsgDepositParams
}
func NewCreateMsgDeposit(
msgCommonParams event.MsgCommonParams,
params model.MsgDepositParams,
) *CreateMsgDeposit {
return &CreateMsgDeposit{
msgCommonParams,
params,
}
}
// Name returns name of command
func (*CreateMsgDeposit) Name() string {
return "CreateMsgDeposit"
}
// Version returns version of command
func (*CreateMsgDeposit) Version() int {
return 1
}
// Exec process the command data and return the event accordingly
func (cmd *CreateMsgDeposit) Exec() (entity_event.Event, error) {
event := event.NewMsgDeposit(cmd.msgCommonParams, cmd.params)
return event, nil
}