Commit f540cf18 authored by Sergey Demyanov's avatar Sergey Demyanov

txmgr: Add Value field support in Tx

parent f37a108c
...@@ -140,6 +140,8 @@ type TxCandidate struct { ...@@ -140,6 +140,8 @@ type TxCandidate struct {
To *common.Address To *common.Address
// GasLimit is the gas limit to be used in the constructed tx. // GasLimit is the gas limit to be used in the constructed tx.
GasLimit uint64 GasLimit uint64
// Value is the value to be used in the constructed tx.
Value *big.Int
} }
// Send is used to publish a transaction with incrementally higher gas prices // Send is used to publish a transaction with incrementally higher gas prices
...@@ -214,6 +216,7 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (* ...@@ -214,6 +216,7 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
GasTipCap: gasTipCap, GasTipCap: gasTipCap,
GasFeeCap: gasFeeCap, GasFeeCap: gasFeeCap,
Data: candidate.TxData, Data: candidate.TxData,
Value: candidate.Value,
} }
m.l.Info("Creating tx", "to", rawTx.To, "from", m.cfg.From) m.l.Info("Creating tx", "to", rawTx.To, "from", m.cfg.From)
...@@ -229,6 +232,7 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (* ...@@ -229,6 +232,7 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
GasFeeCap: gasFeeCap, GasFeeCap: gasFeeCap,
GasTipCap: gasTipCap, GasTipCap: gasTipCap,
Data: rawTx.Data, Data: rawTx.Data,
Value: rawTx.Value,
}) })
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to estimate gas: %w", err) return nil, fmt.Errorf("failed to estimate gas: %w", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment