From 467c56fe7eea7c7c022cc317ad43de749d7c6e78 Mon Sep 17 00:00:00 2001 From: Dan Kanefsky Date: Tue, 30 Jan 2024 14:43:33 -0800 Subject: [PATCH 1/3] minor error handling --- ethereum/broadcast.go | 2 +- noble/listener.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ethereum/broadcast.go b/ethereum/broadcast.go index acd54e9..b5e32eb 100644 --- a/ethereum/broadcast.go +++ b/ethereum/broadcast.go @@ -143,7 +143,7 @@ func (e *Ethereum) attemptBroadcast( response, nonceErr := messageTransmitter.UsedNonces(co, [32]byte(crypto.Keccak256(key))) if nonceErr != nil { - logger.Debug("Error querying whether nonce was used. Continuing...") + logger.Debug("Error querying whether nonce was used. Continuing...", "error:", nonceErr) } else { fmt.Printf("received used nonce response: %d\n", response) if response.Uint64() == uint64(1) { diff --git a/noble/listener.go b/noble/listener.go index 645e42d..82f08b7 100644 --- a/noble/listener.go +++ b/noble/listener.go @@ -78,6 +78,7 @@ func (n *Noble) StartListener( } } case <-ctx.Done(): + fmt.Println("sup here") timer.Stop() return } @@ -95,7 +96,7 @@ func (n *Noble) StartListener( block := <-blockQueue res, err := n.cc.RPCClient.TxSearch(ctx, fmt.Sprintf("tx.height=%d", block), false, nil, nil, "") if err != nil { - logger.Debug(fmt.Sprintf("unable to query Noble block %d", block)) + logger.Debug(fmt.Sprintf("unable to query Noble block %d", block), "error:", err) blockQueue <- block } From f842b9f92c63c34e46eed3269bf0d1ac48338a53 Mon Sep 17 00:00:00 2001 From: Dan Kanefsky Date: Tue, 30 Jan 2024 14:44:15 -0800 Subject: [PATCH 2/3] remove full log --- ethereum/broadcast.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ethereum/broadcast.go b/ethereum/broadcast.go index b5e32eb..b752a14 100644 --- a/ethereum/broadcast.go +++ b/ethereum/broadcast.go @@ -164,14 +164,9 @@ func (e *Ethereum) attemptBroadcast( if err == nil { msg.Status = types.Complete - fullLog, err := tx.MarshalJSON() - if err != nil { - logger.Error("error marshalling eth tx log", err) - } - msg.DestTxHash = tx.Hash().Hex() - logger.Info(fmt.Sprintf("Successfully broadcast %s to Ethereum. Tx hash: %s, FULL LOG: %s", msg.SourceTxHash, msg.DestTxHash, string(fullLog))) + logger.Info(fmt.Sprintf("Successfully broadcast %s to Ethereum. Tx hash: %s", msg.SourceTxHash, msg.DestTxHash)) return nil } From a4ec06e8e9a329ec44b061a691fce61ae43c585a Mon Sep 17 00:00:00 2001 From: Dan Kanefsky Date: Tue, 30 Jan 2024 14:45:46 -0800 Subject: [PATCH 3/3] remove extra print --- noble/listener.go | 1 - 1 file changed, 1 deletion(-) diff --git a/noble/listener.go b/noble/listener.go index 82f08b7..58ff869 100644 --- a/noble/listener.go +++ b/noble/listener.go @@ -78,7 +78,6 @@ func (n *Noble) StartListener( } } case <-ctx.Done(): - fmt.Println("sup here") timer.Stop() return }