From a23125c42d1a70f0db2cf8548fdaf92cf391ca85 Mon Sep 17 00:00:00 2001 From: amit-momin Date: Thu, 14 Dec 2023 17:50:12 -0600 Subject: [PATCH] Added comments --- core/chains/evm/txmgr/common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/chains/evm/txmgr/common.go b/core/chains/evm/txmgr/common.go index 03a98d2c689..d1e851f0c21 100644 --- a/core/chains/evm/txmgr/common.go +++ b/core/chains/evm/txmgr/common.go @@ -40,10 +40,13 @@ func batchSendTransactions( for i, attempt := range attempts { ethTxIDs[i] = attempt.TxID hashes[i] = attempt.Hash.String() + // Decode the signed raw tx back into a Transaction object signedTx, decodeErr := GetGethSignedTx(attempt.SignedRawTx) if decodeErr != nil { return reqs, now, successfulBroadcast, fmt.Errorf("failed to decode signed raw tx into Transaction object: %w", decodeErr) } + // Get the canonical encoding of the Transaction object needed for the eth_sendRawTransaction request + // The signed raw tx cannot be used directly because it uses a different encoding txBytes, marshalErr := signedTx.MarshalBinary() if marshalErr != nil { return reqs, now, successfulBroadcast, fmt.Errorf("failed to marshal tx into canonical encoding: %w", marshalErr)