From af8d0f7dc716af73043a6d2967e020e6324f94a1 Mon Sep 17 00:00:00 2001 From: Cosmos-Harry <110472914+Cosmos-Harry@users.noreply.github.com> Date: Wed, 17 May 2023 22:49:10 -0400 Subject: [PATCH] Harry/rly tx transfer (#1184) * 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 Co-authored-by: Andrew Gouin --- relayer/packet-tx.go | 10 +++++++++- relayer/relayMsgs.go | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/relayer/packet-tx.go b/relayer/packet-tx.go index ecc2146e0..1cb38c7b3 100644 --- a/relayer/packet-tx.go +++ b/relayer/packet-tx.go @@ -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 } diff --git a/relayer/relayMsgs.go b/relayer/relayMsgs.go index 52d95f160..698e8b28a 100644 --- a/relayer/relayMsgs.go +++ b/relayer/relayMsgs.go @@ -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 {