-
Notifications
You must be signed in to change notification settings - Fork 15
/
icon_client_extended.go
166 lines (136 loc) · 4.37 KB
/
icon_client_extended.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
package icon
import (
"time"
ics23 "github.com/confio/ics23/go"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
)
var _ exported.ClientState = (*ClientState)(nil)
func NewClientState(
TrustingPeriod uint64,
FrozenHeight uint64,
MaxClockDrift uint64,
LatestHeight uint64,
SrcNetworkId string,
NetworkId uint64,
NetworkTypeId uint64,
) *ClientState {
return &ClientState{
TrustingPeriod,
FrozenHeight,
MaxClockDrift,
LatestHeight,
SrcNetworkId,
NetworkId,
NetworkTypeId,
}
}
// GetChainID returns the chain-id
func (cs ClientState) GetChainID() string {
return "icon"
}
// ClientType is icon
func (cs ClientState) ClientType() string {
return "07-icon"
}
func (cs ClientState) GetLatestHeight() exported.Height {
return types.Height{
RevisionHeight: uint64(cs.LatestHeight),
}
}
// GetTimestampAtHeight returns the timestamp in nanoseconds of the consensus state at the given height.
func (cs ClientState) GetTimestampAtHeight(
ctx sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
) (uint64, error) {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) Status(
ctx sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
) exported.Status {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) IsExpired(latestTimestamp, now time.Time) bool {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) Validate() error {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) GetProofSpecs() []*ics23.ProofSpec {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) ZeroCustomFields() exported.ClientState {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, consState exported.ConsensusState) error {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) VerifyMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
delayBlockPeriod uint64,
proof []byte,
path exported.Path,
value []byte,
) error {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) VerifyNonMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
delayBlockPeriod uint64,
proof []byte,
path exported.Path,
) error {
panic("Icon Light Client: Do not use")
}
func (cs *ClientState) verifyMisbehaviour(ctx sdk.Context, clientStore sdk.KVStore, cdc codec.BinaryCodec, misbehaviour *tmclient.Misbehaviour) error {
panic("Icon Light Client: Do not use")
}
func checkMisbehaviourHeader(
clientState *ClientState, consState *ConsensusState, header *tmclient.Header, currentTimestamp time.Time,
) error {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) ExportMetadata(store sdk.KVStore) []exported.GenesisMetadata {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) error {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) bool {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) []exported.Height {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, substituteClientStore sdk.KVStore, substituteClient exported.ClientState) error {
panic("Icon Light Client: Do not use")
}
func (cs ClientState) VerifyUpgradeAndUpdateState(
ctx sdk.Context,
cdc codec.BinaryCodec,
store sdk.KVStore,
newClient exported.ClientState,
newConsState exported.ConsensusState,
proofUpgradeClient,
proofUpgradeConsState []byte,
) error {
panic("Icon Light Client: Do not use")
}