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