@@ -2,6 +2,7 @@ package txmgr
22
33import (
44 "context"
5+ "errors"
56 "fmt"
67 "math/big"
78 "time"
@@ -113,7 +114,7 @@ func NewTxmV2(
113114 logPoller logpoller.LogPoller ,
114115 keyStore keys.ChainStore ,
115116 estimator gas.EvmFeeEstimator ,
116- emptyTxLimitDefault uint64 ,
117+ gasEstimatorConfig config. GasEstimator ,
117118) (TxManager , error ) {
118119 var fwdMgr * forwarders.FwdMgr
119120 if txConfig .ForwardersEnabled () {
@@ -138,14 +139,19 @@ func NewTxmV2(
138139 stuckTxDetector = txm .NewStuckTxDetector (lggr , chainConfig .ChainType (), stuckTxDetectorConfig )
139140 }
140141
141- attemptBuilder := txm .NewAttemptBuilder (fCfg .PriceMaxKey , estimator , keyStore , emptyTxLimitDefault )
142+ // TODO: temporary check until we implement the required methods on the estimator interface
143+ if gasEstimatorConfig .Mode () != "BlockHistory" || gasEstimatorConfig .BlockHistory ().CheckInclusionBlocks () == 0 {
144+ return nil , errors .New ("only BlockHistory mode with CheckInclusionBlocks > 0 is supported for TXMv2" )
145+ }
146+
147+ attemptBuilder := txm .NewAttemptBuilder (fCfg .PriceMaxKey , estimator , keyStore , gasEstimatorConfig .LimitTransfer ())
142148 inMemoryStoreManager := storage .NewInMemoryStoreManager (lggr , chainID )
143149 config := txm.Config {
144150 EIP1559 : fCfg .EIP1559DynamicFees (),
145151 BlockTime : * txmV2Config .BlockTime (),
146152 //nolint:gosec // reuse existing config until migration
147153 RetryBlockThreshold : uint16 (fCfg .BumpThreshold ()),
148- EmptyTxLimitDefault : emptyTxLimitDefault ,
154+ EmptyTxLimitDefault : gasEstimatorConfig . LimitTransfer () ,
149155 }
150156 var eh txm.ErrorHandler
151157 var c txm.Client
0 commit comments