@@ -74,7 +74,7 @@ type InitialState struct {
74
74
// CreateInitialLightClientState returns a pair of ClientState and ConsensusState based on the state of the self chain at `height`.
75
75
// These states will be submitted to the counterparty chain as MsgCreateClient.
76
76
// If `height` is nil, the latest finalized height is selected automatically.
77
- func (pr * Prover ) CreateInitialLightClientState (height ibcexported.Height ) (ibcexported.ClientState , ibcexported.ConsensusState , error ) {
77
+ func (pr * Prover ) CreateInitialLightClientState (ctx context. Context , height ibcexported.Height ) (ibcexported.ClientState , ibcexported.ConsensusState , error ) {
78
78
if height == nil {
79
79
height = pr .newHeight (0 )
80
80
}
@@ -111,7 +111,7 @@ func (pr *Prover) CreateInitialLightClientState(height ibcexported.Height) (ibce
111
111
// SetupHeadersForUpdate returns the finalized header and any intermediate headers needed to apply it to the client on the counterpaty chain
112
112
// The order of the returned header slice should be as: [<intermediate headers>..., <update header>]
113
113
// if the header slice's length == 0 and err == nil, the relayer should skips the update-client
114
- func (pr * Prover ) SetupHeadersForUpdate (counterparty core.FinalityAwareChain , latestFinalizedHeader core.Header ) ([]core.Header , error ) {
114
+ func (pr * Prover ) SetupHeadersForUpdate (ctx context. Context , counterparty core.FinalityAwareChain , latestFinalizedHeader core.Header ) ([]core.Header , error ) {
115
115
lfh , ok := latestFinalizedHeader .(* lctypes.Header )
116
116
if ! ok {
117
117
return nil , fmt .Errorf ("unexpected header type: %T" , latestFinalizedHeader )
@@ -120,7 +120,7 @@ func (pr *Prover) SetupHeadersForUpdate(counterparty core.FinalityAwareChain, la
120
120
return nil , err
121
121
}
122
122
123
- latestHeight , err := counterparty .LatestHeight ()
123
+ latestHeight , err := counterparty .LatestHeight (context . TODO () )
124
124
if err != nil {
125
125
return nil , err
126
126
}
@@ -230,7 +230,7 @@ func (pr *Prover) buildInitialState(blockNumber uint64) (*InitialState, error) {
230
230
return nil , fmt .Errorf ("the height is not finalized yet: blockNumber=%v finalized_block_number=%v" , blockNumber , eh .BlockNumber )
231
231
}
232
232
233
- timestamp , err := pr .chain .Timestamp (pr .newHeight (int64 (blockNumber )))
233
+ timestamp , err := pr .chain .Timestamp (context . TODO (), pr .newHeight (int64 (blockNumber )))
234
234
if err != nil {
235
235
return nil , fmt .Errorf ("failed to get timestamp: %v" , err )
236
236
}
@@ -278,7 +278,7 @@ func (pr *Prover) buildInitialState(blockNumber uint64) (*InitialState, error) {
278
278
279
279
// buildLatestFinalizedHeader returns the latest finalized header on this chain
280
280
// The returned header is expected to be the latest one of headers that can be verified by the light client
281
- func (pr * Prover ) GetLatestFinalizedHeader () (headers core.Header , err error ) {
281
+ func (pr * Prover ) GetLatestFinalizedHeader (ctx context. Context ) (headers core.Header , err error ) {
282
282
res , err := pr .beaconClient .GetLightClientFinalityUpdate ()
283
283
if err != nil {
284
284
return nil , err
@@ -310,8 +310,8 @@ func (pr *Prover) GetLatestFinalizedHeader() (headers core.Header, err error) {
310
310
}, nil
311
311
}
312
312
313
- func (pr * Prover ) CheckRefreshRequired (counterparty core.ChainInfoICS02Querier ) (bool , error ) {
314
- cpQueryHeight , err := counterparty .LatestHeight ()
313
+ func (pr * Prover ) CheckRefreshRequired (ctx context. Context , counterparty core.ChainInfoICS02Querier ) (bool , error ) {
314
+ cpQueryHeight , err := counterparty .LatestHeight (context . TODO () )
315
315
if err != nil {
316
316
return false , fmt .Errorf ("failed to get the latest height of the counterparty chain: %v" , err )
317
317
}
@@ -338,12 +338,12 @@ func (pr *Prover) CheckRefreshRequired(counterparty core.ChainInfoICS02Querier)
338
338
}
339
339
lcLastTimestamp := time .Unix (0 , int64 (cons .GetTimestamp ()))
340
340
341
- selfQueryHeight , err := pr .chain .LatestHeight ()
341
+ selfQueryHeight , err := pr .chain .LatestHeight (context . TODO () )
342
342
if err != nil {
343
343
return false , fmt .Errorf ("failed to get the latest height of the self chain: %v" , err )
344
344
}
345
345
346
- selfTimestamp , err := pr .chain .Timestamp (selfQueryHeight )
346
+ selfTimestamp , err := pr .chain .Timestamp (context . TODO (), selfQueryHeight )
347
347
if err != nil {
348
348
return false , fmt .Errorf ("failed to get timestamp of the self chain: %v" , err )
349
349
}
0 commit comments