Skip to content

Commit

Permalink
revert renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsitrin committed Nov 17, 2024
1 parent 4859c51 commit b28295a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions x/lightclient/keeper/canonical_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion x/lightclient/keeper/hook_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit b28295a

Please sign in to comment.