Skip to content

Commit

Permalink
add named returnes (cosmos#352)
Browse files Browse the repository at this point in the history
* add named returnes

* delete unnecessary err handling

* add error handling
  • Loading branch information
Doarakko authored Jan 11, 2021
1 parent 0ebe4cf commit 01b7d01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions relayer/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,15 +633,13 @@ func (c *Chain) StatusErr() error {

// GenerateConnHandshakeProof generates all the proofs needed to prove the existence of the
// connection state on this chain. A counterparty should use these generated proofs.
func (c *Chain) GenerateConnHandshakeProof(height uint64) (ibcexported.ClientState, []byte, []byte, []byte, clienttypes.Height, error) {
func (c *Chain) GenerateConnHandshakeProof(height uint64) (clientState ibcexported.ClientState, clientStateProof []byte, consensusProof []byte, connectionProof []byte, connectionProofHeight clienttypes.Height, err error) {
var (
clientState ibcexported.ClientState
clientStateRes *clienttypes.QueryClientStateResponse
consensusStateRes *clienttypes.QueryConsensusStateResponse
connectionStateRes *connectiontypes.QueryConnectionResponse

eg = new(errgroup.Group)
err error
eg = new(errgroup.Group)
)

// query for the client state for the proof and get the height to query the consensus state at.
Expand Down
3 changes: 0 additions & 3 deletions relayer/client-tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ func (c *Chain) UpgradeClients(dst *Chain) error {
}

upgradeMsg := &clienttypes.MsgUpgradeClient{c.PathEnd.ClientID, clientState, consensusState, proofUpgradeClient, proofUpgradeConsensusState, c.MustGetAddress().String()}
if err != nil {
return err
}

msgs := []sdk.Msg{
c.PathEnd.UpdateClient(dstUpdateHeader, c.MustGetAddress()),
Expand Down
2 changes: 1 addition & 1 deletion relayer/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (p *Path) QueryPathStatus(src, dst *Chain) *PathWithStatus {
dsth, err = dst.QueryLatestHeight()
return err
})
if eg.Wait(); err != nil {
if err = eg.Wait(); err != nil {
return out
}
out.Status.Chains = true
Expand Down

0 comments on commit 01b7d01

Please sign in to comment.