Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-momin committed Dec 14, 2023
1 parent bab739a commit a23125c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/chains/evm/txmgr/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a23125c

Please sign in to comment.