-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yaru Wang
committed
Jul 28, 2023
1 parent
ee5c6f6
commit 8ddb410
Showing
2 changed files
with
25 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package keeper | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
Check failure on line 4 in x/ccv/consumer/keeper/provider_info.go GitHub Actions / lint
|
||
ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" | ||
Check failure on line 5 in x/ccv/consumer/keeper/provider_info.go GitHub Actions / lint
|
||
"github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" | ||
) | ||
|
||
func (k Keeper) GetProviderChainInfo(ctx sdk.Context) (*types.QueryProviderInfoResponse, error) { | ||
providerClientID, found := k.GetProviderClientID(ctx) | ||
if !found { | ||
return nil, nil | ||
} | ||
clientState, found := k.clientKeeper.GetClientState(ctx, providerClientID) | ||
if !found { | ||
return nil, nil | ||
} | ||
providerChainID := clientState.(*ibctm.ClientState).ChainId | ||
resp := types.QueryProviderInfoResponse{ | ||
ChainID: providerChainID, | ||
} | ||
|
||
return &resp, nil | ||
} |