-
Notifications
You must be signed in to change notification settings - Fork 4
/
client_update.go
41 lines (34 loc) · 1023 Bytes
/
client_update.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
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"
)
// MsgUpdateClient defines a message to update an IBC client
type DocMsgUpdateClient struct {
ClientId string `bson:"client_id" yaml:"client_id"`
Header string `bson:"header" yaml:"header"`
Signer string `bson:"signer" yaml:"signer"`
}
func (m *DocMsgUpdateClient) GetType() string {
return MsgTypeUpdateClient
}
func (m *DocMsgUpdateClient) BuildMsg(v interface{}) {
msg := v.(*MsgUpdateClient)
m.ClientId = msg.ClientId
m.Signer = msg.Signer
m.Header = ConvertAny(msg.Header)
}
func (m *DocMsgUpdateClient) HandleTxMsg(v SdkMsg) MsgDocInfo {
var (
addrs []string
msg MsgUpdateClient
)
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)
}