Skip to content

Commit

Permalink
Output dynamic fee specific fields in tx relayer (#1936)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal authored Sep 26, 2023
1 parent 8aaae11 commit cf7c675
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions txrelayer/txrelayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,18 @@ func (t *TxRelayerImpl) sendTransactionLocked(txn *ethgo.Transaction, key ethgo.
}

if t.writer != nil {
_, _ = t.writer.Write([]byte(
fmt.Sprintf("[TxRelayer.SendTransaction]\nFrom = %s \nGas = %d \nGas Price = %d\n",
txn.From, txn.Gas, txn.GasPrice)))
var msg string

if txn.Type == ethgo.TransactionDynamicFee {
msg = fmt.Sprintf("[TxRelayer.SendTransaction]\nFrom = %s\nGas = %d\n"+
"Max Fee Per Gas = %d\nMax Priority Fee Per Gas = %d\n",
txn.From, txn.Gas, txn.MaxFeePerGas, txn.MaxPriorityFeePerGas)
} else {
msg = fmt.Sprintf("[TxRelayer.SendTransaction]\nFrom = %s\nGas = %d\nGas Price = %d\n",
txn.From, txn.Gas, txn.GasPrice)
}

_, _ = t.writer.Write([]byte(msg))
}

return t.client.Eth().SendRawTransaction(data)
Expand Down

0 comments on commit cf7c675

Please sign in to comment.