-
Notifications
You must be signed in to change notification settings - Fork 9
/
header.go
51 lines (41 loc) · 1.18 KB
/
header.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
44
45
46
47
48
49
50
51
package types
import (
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
)
var _ exported.ClientMessage = (*UpdateClientMessage)(nil)
func (UpdateClientMessage) ClientType() string {
return ClientTypeLCP
}
func (m UpdateClientMessage) GetHeight() exported.Height {
c, err := m.GetCommitment()
if err != nil {
panic(err)
}
return c.NewHeight
}
func (m UpdateClientMessage) ValidateBasic() error {
if _, err := m.GetCommitment(); err != nil {
return err
}
return nil
}
func (h UpdateClientMessage) GetCommitment() (*UpdateClientCommitment, error) {
c, err := EthABIDecodeHeaderedCommitment(h.Commitment)
if err != nil {
return nil, err
}
return c.GetUpdateClientCommitment()
}
var _ exported.ClientMessage = (*RegisterEnclaveKeyMessage)(nil)
func (RegisterEnclaveKeyMessage) ClientType() string {
return ClientTypeLCP
}
func (RegisterEnclaveKeyMessage) GetHeight() exported.Height {
// XXX: the header doesn't have height info, so return zero
// this is just workaround until this function removed
return clienttypes.ZeroHeight()
}
func (RegisterEnclaveKeyMessage) ValidateBasic() error {
return nil
}