Skip to content

Commit

Permalink
feat: add logger to PrepChain
Browse files Browse the repository at this point in the history
this removes the need of having two identical checks
  • Loading branch information
jlehtimaki committed Oct 31, 2023
1 parent 321b778 commit cdc524e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 4 additions & 3 deletions pkg/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/cosmos/relayer/v2/relayer"
"github.com/cosmos/relayer/v2/relayer/chains/cosmos"
"go.uber.org/zap"
)

const (
Expand All @@ -19,7 +20,7 @@ type Info struct {
}

func PrepChain(info Info) (*relayer.Chain, error) {
chain := relayer.Chain{}
logger := zap.NewNop()
providerConfig := cosmos.CosmosProviderConfig{
ChainID: info.ChainID,
Timeout: rpcTimeout,
Expand All @@ -37,12 +38,12 @@ func PrepChain(info Info) (*relayer.Chain, error) {
return nil, err
}

chain.ChainProvider = provider
chain := relayer.NewChain(logger, provider, false)

err = chain.SetPath(&relayer.PathEnd{ClientID: info.ClientID})
if err != nil {
return nil, err
}

return &chain, nil
return chain, nil
}
7 changes: 0 additions & 7 deletions pkg/ibc/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,6 @@ func GetChannelsInfo(ibc *relayer.IBCdata, rpcs *map[string]config.RPC) (Channel
return ChannelsInfo{}, fmt.Errorf("Error: %w for %v", err, cdB)
}

// test that RPC endpoints are working
if _, _, err := relayer.QueryLatestHeights(
ctx, chainA, chainB,
); err != nil {
return channelInfo, fmt.Errorf("Error: %w for %v", err, cdA)
}

for i, c := range channelInfo.Channels {
var order chantypes.Order

Expand Down

0 comments on commit cdc524e

Please sign in to comment.