-
Notifications
You must be signed in to change notification settings - Fork 9
/
header.go
49 lines (39 loc) · 1.2 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
package types
import (
clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v4/modules/core/exported"
)
var _ exported.Header = (*UpdateClientHeader)(nil)
func (h UpdateClientHeader) ClientType() string {
return ClientTypeLCP
}
// NOTE: `GetHeight` will be removed in the near feature
func (h UpdateClientHeader) GetHeight() exported.Height {
c, err := h.GetCommitment()
if err != nil {
panic(err)
}
return c.NewHeight
}
func (h UpdateClientHeader) ValidateBasic() error {
if _, err := h.GetCommitment(); err != nil {
return err
}
return nil
}
func (h UpdateClientHeader) GetCommitment() (*UpdateClientCommitment, error) {
return ParseUpdateClientCommitment(h.Commitment)
}
var _ exported.Header = (*RegisterEnclaveKeyHeader)(nil)
func (h RegisterEnclaveKeyHeader) ClientType() string {
return ClientTypeLCP
}
// NOTE: `GetHeight` will be removed in the near feature
func (h RegisterEnclaveKeyHeader) 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 (h RegisterEnclaveKeyHeader) ValidateBasic() error {
return nil
}