Skip to content

Commit

Permalink
Merge pull request #43 from strangelove-ventures/dan/minor-err
Browse files Browse the repository at this point in the history
Minor error handling
  • Loading branch information
boojamya authored Jan 31, 2024
2 parents 7a98c69 + a4ec06e commit c7f0bcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions ethereum/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion noble/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,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
}

Expand Down

0 comments on commit c7f0bcb

Please sign in to comment.