Skip to content

Commit

Permalink
fix: context again
Browse files Browse the repository at this point in the history
  • Loading branch information
shahbazn committed Dec 1, 2023
1 parent 6adf410 commit ff86cac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Info struct {
Timeout string
}

func PrepChain(info Info) (*relayer.Chain, error) {
func PrepChain(ctx context.Context, info Info) (*relayer.Chain, error) {
timeout := rpcTimeout
if info.Timeout != "" {
timeout = info.Timeout
Expand All @@ -39,7 +39,7 @@ func PrepChain(info Info) (*relayer.Chain, error) {
return nil, err
}

err = provider.Init(context.Background())
err = provider.Init(ctx)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type Discord struct {
}

func (a *Account) GetBalance(ctx context.Context, rpcs *map[string]RPC) error {
chain, err := chain.PrepChain(chain.Info{
chain, err := chain.PrepChain(ctx, chain.Info{
ChainID: (*rpcs)[a.ChainName].ChainID,
RPCAddr: (*rpcs)[a.ChainName].URL,
Timeout: (*rpcs)[a.ChainName].Timeout,
Expand Down
8 changes: 4 additions & 4 deletions pkg/ibc/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func GetClientsInfo(ctx context.Context, ibc *config.IBCData, rpcs *map[string]c
ClientID: ibc.Chain1.ClientID,
}

chainA, err := chain.PrepChain(cdA)
chainA, err := chain.PrepChain(ctx, cdA)
if err != nil {
return ClientsInfo{}, fmt.Errorf("%w for %v", err, cdA)
}
Expand All @@ -63,7 +63,7 @@ func GetClientsInfo(ctx context.Context, ibc *config.IBCData, rpcs *map[string]c
ClientID: ibc.Chain2.ClientID,
}

chainB, err := chain.PrepChain(cdB)
chainB, err := chain.PrepChain(ctx, cdB)
if err != nil {
return ClientsInfo{}, fmt.Errorf("%w for %v", err, cdB)
}
Expand Down Expand Up @@ -119,7 +119,7 @@ func GetChannelsInfo(ctx context.Context, ibc *config.IBCData, rpcs *map[string]
ClientID: ibc.Chain1.ClientID,
}

chainA, err := chain.PrepChain(cdA)
chainA, err := chain.PrepChain(ctx, cdA)
if err != nil {
return ChannelsInfo{}, fmt.Errorf("Error: %w for %v", err, cdA)
}
Expand All @@ -131,7 +131,7 @@ func GetChannelsInfo(ctx context.Context, ibc *config.IBCData, rpcs *map[string]
ClientID: ibc.Chain2.ClientID,
}

chainB, err := chain.PrepChain(cdB)
chainB, err := chain.PrepChain(ctx, cdB)
if err != nil {
return ChannelsInfo{}, fmt.Errorf("Error: %w for %v", err, cdB)
}
Expand Down

0 comments on commit ff86cac

Please sign in to comment.