Skip to content

Commit

Permalink
use the name given by the user to generate the fetch URL
Browse files Browse the repository at this point in the history
  • Loading branch information
murataniloener committed Jul 7, 2023
1 parent 1bfe06c commit 7684d44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ func addChainsFromRegistry(ctx context.Context, a *appState, chains []string) er
continue
}

chainConfig, err := chainInfo.GetChainConfig(ctx)
chainConfig, err := chainInfo.GetChainConfig(ctx, chain)
if err != nil {
a.log.Warn(
"Error generating chain config",
Expand Down
8 changes: 4 additions & 4 deletions cregistry/chain_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ func (c ChainInfo) GetRandomRPCEndpoint(ctx context.Context) (string, error) {
}

// GetAssetList returns the asset metadata from the cosmos chain registry for this particular chain.
func (c ChainInfo) GetAssetList(ctx context.Context) (AssetList, error) {
chainRegURL := fmt.Sprintf("https://raw.githubusercontent.com/cosmos/chain-registry/master/%s/assetlist.json", c.ChainName)
func (c ChainInfo) GetAssetList(ctx context.Context, name string) (AssetList, error) {
chainRegURL := fmt.Sprintf("https://raw.githubusercontent.com/cosmos/chain-registry/master/%s/assetlist.json", name)

res, err := http.Get(chainRegURL)
if err != nil {
Expand Down Expand Up @@ -236,11 +236,11 @@ func (c ChainInfo) GetAssetList(ctx context.Context) (AssetList, error) {

// GetChainConfig returns a CosmosProviderConfig composed from the details found in the cosmos chain registry for
// this particular chain.
func (c ChainInfo) GetChainConfig(ctx context.Context) (*cosmos.CosmosProviderConfig, error) {
func (c ChainInfo) GetChainConfig(ctx context.Context, name string) (*cosmos.CosmosProviderConfig, error) {
debug := viper.GetBool("debug")
home := viper.GetString("home")

assetList, err := c.GetAssetList(ctx)
assetList, err := c.GetAssetList(ctx, name)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7684d44

Please sign in to comment.