From a30383b9f1c400d1ce8f94b868f9629564ede621 Mon Sep 17 00:00:00 2001 From: Masanori Yoshida Date: Fri, 24 May 2024 13:56:47 +0900 Subject: [PATCH] add "msg_type" log attribute in SendMsgs Signed-off-by: Masanori Yoshida --- pkg/relay/ethereum/log.go | 1 + pkg/relay/ethereum/tx.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/relay/ethereum/log.go b/pkg/relay/ethereum/log.go index df397b0..48e5bb5 100644 --- a/pkg/relay/ethereum/log.go +++ b/pkg/relay/ethereum/log.go @@ -2,6 +2,7 @@ package ethereum const ( logAttrMsgIndex = "msg_index" + logAttrMsgType = "msg_type" logAttrRevertReason = "revert_reason" logAttrRawErrorData = "raw_error_data" logAttrRawTxData = "raw_tx_data" diff --git a/pkg/relay/ethereum/tx.go b/pkg/relay/ethereum/tx.go index f9b4ea6..71d935f 100644 --- a/pkg/relay/ethereum/tx.go +++ b/pkg/relay/ethereum/tx.go @@ -36,7 +36,10 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { logger := c.GetChainLogger() var msgIDs []core.MsgID for i, msg := range msgs { - logger := &log.RelayLogger{Logger: logger.With(logAttrMsgIndex, i)} + logger := &log.RelayLogger{Logger: logger.With( + logAttrMsgIndex, i, + logAttrMsgType, fmt.Sprintf("%T", msg), + )} opts, err := c.TxOpts(ctx) if err != nil {