From b28295a14e13ac93f5947c6c1a44dad498e6bd2f Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Sun, 17 Nov 2024 15:28:10 +0200 Subject: [PATCH] revert renaming --- x/lightclient/keeper/canonical_client.go | 8 +++----- x/lightclient/keeper/hook_listener.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/x/lightclient/keeper/canonical_client.go b/x/lightclient/keeper/canonical_client.go index 903ddeb6f..c2eaec6b2 100644 --- a/x/lightclient/keeper/canonical_client.go +++ b/x/lightclient/keeper/canonical_client.go @@ -13,15 +13,13 @@ import ( "github.com/dymensionxyz/gerr-cosmos/gerrc" ) -var errChainIDMismatch = errors.New("chain id mismatch") - -// FindPotentialClient returns the client id of the first IBC client which can be set as the canonical client for the given rollapp. +// GetProspectiveCanonicalClient returns the client id of the first IBC client which can be set as the canonical client for the given rollapp. // The canonical client criteria are: // 1. The client must be a tendermint client. // 2. The client state must match the expected client params as configured by the module // 3. The client state must have the same chain id as the rollapp id. -// 4. The client state must have a consensus state which is compatible with the state info. -func (k Keeper) FindPotentialClient(ctx sdk.Context, sInfo *rollapptypes.StateInfo) (clientID string, found bool) { +// 4. All the existing consensus states much match the corresponding height rollapp block descriptors +func (k Keeper) GetProspectiveCanonicalClient(ctx sdk.Context, sInfo *rollapptypes.StateInfo) (clientID string, found bool) { k.ibcClientKeeper.IterateClientStates(ctx, nil, func(client string, cs exported.ClientState) bool { rollappId := sInfo.GetRollappId() diff --git a/x/lightclient/keeper/hook_listener.go b/x/lightclient/keeper/hook_listener.go index d619f0a2a..b7bc916c9 100644 --- a/x/lightclient/keeper/hook_listener.go +++ b/x/lightclient/keeper/hook_listener.go @@ -43,7 +43,7 @@ func (hook rollappHook) AfterUpdateState( } } else { var ok bool - client, ok = hook.k.FindPotentialClient(ctx, stateInfo) + client, ok = hook.k.GetProspectiveCanonicalClient(ctx, stateInfo) if !ok { return nil }