Skip to content

Commit

Permalink
Harry/rly tx transfer (cosmos#1184)
Browse files Browse the repository at this point in the history
* made a new method "logChannelOpenMessage" to log the newly opened channel into info level

* added fields

* some changes

* recreated issue 1151, added logs

---------

Co-authored-by: Harry <[email protected]>
Co-authored-by: Andrew Gouin <[email protected]>
  • Loading branch information
3 people authored May 18, 2023
1 parent 45f478b commit af8d0f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion relayer/packet-tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,15 @@ func (c *Chain) SendTransferMsg(ctx context.Context, log *zap.Logger, dst *Chain
)
}
return err
} else {
if result.SuccessfullySent() {
c.log.Info(
"Successfully sent a transfer",
zap.String("src_chain_id", c.ChainID()),
zap.String("dst_chain_id", dst.ChainID()),
zap.Object("send_result", result),
)
}
}

return nil
}
5 changes: 5 additions & 0 deletions relayer/relayMsgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ type SendMsgsResult struct {
SrcSendError, DstSendError error
}

// SuccessfullySent reports the presence successfully sent batches
func (r SendMsgsResult) SuccessfullySent() bool {
return (r.SuccessfulSrcBatches > 0 || r.SuccessfulDstBatches > 0)
}

// PartiallySent reports the presence of both some successfully sent batches
// and some errors.
func (r SendMsgsResult) PartiallySent() bool {
Expand Down

0 comments on commit af8d0f7

Please sign in to comment.