-
Notifications
You must be signed in to change notification settings - Fork 4
/
client_create.go
43 lines (34 loc) · 1.03 KB
/
client_create.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
39
40
41
42
43
package ibc
import (
cdc "github.com/kaifei-bianjie/common-parser/codec"
. "github.com/kaifei-bianjie/common-parser/modules"
. "github.com/kaifei-bianjie/cosmosmod-parser/modules"
)
// MsgCreateClient defines a message to create an IBC client
type DocMsgCreateClient struct {
ClientState string `bson:"client_state"`
ConsensusState string `bson:"consensus_state"`
Signer string `bson:"signer" yaml:"signer"`
}
func (m *DocMsgCreateClient) GetType() string {
return MsgTypeCreateClient
}
func (m *DocMsgCreateClient) BuildMsg(v interface{}) {
msg := v.(*MsgCreateClient)
m.Signer = msg.Signer
m.ClientState = ConvertAny(msg.ClientState)
m.ConsensusState = ConvertAny(msg.ConsensusState)
}
func (m *DocMsgCreateClient) HandleTxMsg(v SdkMsg) MsgDocInfo {
var (
addrs []string
msg MsgCreateClient
)
data, _ := cdc.GetMarshaler().MarshalJSON(v)
cdc.GetMarshaler().UnmarshalJSON(data, &msg)
addrs = append(addrs, msg.Signer)
handler := func() (Msg, []string) {
return m, addrs
}
return CreateMsgDocInfo(v, handler)
}