diff --git a/CONFIG.md b/CONFIG.md index 782a92014c..027353d47e 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -270,6 +270,7 @@ Set to zero to disable. ## Transactions ```toml [Transactions] +ConfirmationTimeout = '60s' # Default Enabled = true # Default ForwardersEnabled = false # Default MaxInFlight = 16 # Default @@ -280,6 +281,12 @@ ResendAfterThreshold = '1m' # Default ``` +### ConfirmationTimeout +```toml +ConfirmationTimeout = '60s' # Default +``` +ConfirmationTimeout time to wait for a TX to get into a block in the blockchain. This is used for the EVMService.SubmitTransaction operation. + ### Enabled ```toml Enabled = true # Default @@ -1233,6 +1240,9 @@ GasLimit controls the gas limit for transmit transactions from ocr2automation jo FromAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example ForwarderAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example GasLimitDefault = 400_000 # Default +TxAcceptanceState = 2 # Default +PollPeriod = '2s' # Default +AcceptanceTimeout = '30s' # Default ``` @@ -1254,3 +1264,21 @@ GasLimitDefault = 400_000 # Default ``` GasLimitDefault is the default gas limit for workflow transactions. +### TxAcceptanceState +```toml +TxAcceptanceState = 2 # Default +``` +TxAcceptanceState is the default acceptance state for writer DON tranmissions. + +### PollPeriod +```toml +PollPeriod = '2s' # Default +``` +PollPeriod is the default poll period for checking transmission state + +### AcceptanceTimeout +```toml +AcceptanceTimeout = '30s' # Default +``` +AcceptanceTimeout is the default timeout for a tranmission to be accepted on chain + diff --git a/gethwrappers/zksync/go_generate.go b/gethwrappers/zksync/go_generate.go index 3af8c37369..6a33f91c4f 100644 --- a/gethwrappers/zksync/go_generate.go +++ b/gethwrappers/zksync/go_generate.go @@ -8,4 +8,4 @@ package gethwrappers //go:generate go run ../generation/zksync/wrap.go shared WETH9ZKSync weth9_zksync //go:generate go run ../generation/zksync/wrap.go shared MockV3Aggregator mock_v3_aggregator_contract -//go:generate go run ../generation/zksync/wrap.go automation MockETHUSDAggregator mock_ethusd_aggregator_wrapper +//go:generate go run ../generation/zksync/wrap.go automation MockETHUSDAggregator mock_ethusd_aggregator_wrapper \ No newline at end of file diff --git a/go.mod b/go.mod index 2edc164e46..4509cc6a97 100644 --- a/go.mod +++ b/go.mod @@ -21,9 +21,9 @@ require ( github.com/prometheus/client_model v0.6.1 github.com/prometheus/common v0.63.0 github.com/shopspring/decimal v1.4.0 - github.com/smartcontractkit/chainlink-common v0.7.1-0.20250618162808-a5a42ee8701b + github.com/smartcontractkit/chainlink-common v0.7.1-0.20250627002929-2cbb7418aaa5 github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250618164021-9b34289a9502 - github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250616180023-87b70c08d7c0 + github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250627121608-e7b52913fae2 github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20250618135814-7e3f79ab707e github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250522110034-65c54665034a github.com/smartcontractkit/chainlink-protos/svr v1.1.0 @@ -92,7 +92,7 @@ require ( github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.25.0 // indirect - github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + github.com/go-viper/mapstructure/v2 v2.3.0 // indirect github.com/goccy/go-json v0.10.5 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -155,6 +155,7 @@ require ( github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 // indirect github.com/scylladb/go-reflectx v1.0.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect + github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250626141212-e50b2e7ffe2d // indirect github.com/smartcontractkit/freeport v0.1.1 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect diff --git a/go.sum b/go.sum index 12ee2980f1..02e4fd4da9 100644 --- a/go.sum +++ b/go.sum @@ -231,8 +231,8 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8Wd github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= -github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= +github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -636,12 +636,14 @@ github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJV github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartcontractkit/chainlink-common v0.7.1-0.20250618162808-a5a42ee8701b h1:nS5njF5W9lY1LnTITt3V2M35dT19JPpuVg6//vlzFiU= -github.com/smartcontractkit/chainlink-common v0.7.1-0.20250618162808-a5a42ee8701b/go.mod h1:1ntZ0rtQpPx6h+xlcOJp0ccqHFaxTzW2Z62FJG358q0= +github.com/smartcontractkit/chainlink-common v0.7.1-0.20250627002929-2cbb7418aaa5 h1:ZadFXdmkBFJz3GYPAF20IvtNSHbcRFoLrhCU/LKS9oQ= +github.com/smartcontractkit/chainlink-common v0.7.1-0.20250627002929-2cbb7418aaa5/go.mod h1:mRKPMPyJhg1RBjxtRTL2gHvRhTcZ+nk2Upu/u97Y16M= +github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250626141212-e50b2e7ffe2d h1:86gp4tIXRb6ccSrjcm4gV8iA5wJN6er3rJY9f2UxRLU= +github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250626141212-e50b2e7ffe2d/go.mod h1:QUEPHdSkH19Or+E1iMGG+rDQ6jpCTIbm//9Osa6MXDE= github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250618164021-9b34289a9502 h1:WLgEB8/lIfA1vI+7O4RE/PYitO57TRkKUqVllDIgJD4= github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250618164021-9b34289a9502/go.mod h1:Kb8f+wt2YmBdD0PfbsC9bDhdUG/Y8sqUkzAvC2Dn8/M= -github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250616180023-87b70c08d7c0 h1:OpFlG2f+LXsDp3cejSQju2rmoNsxBlhgrwXMIsk72IA= -github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250616180023-87b70c08d7c0/go.mod h1:X+a4k2a+2G2/yeAaRQMCTLmlhNdQYAeN6v+ZpLzRZww= +github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250627121608-e7b52913fae2 h1:WRwVcv2IW59subaJDNl6B+N4OkZiAO7U2e9001XSw7c= +github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250627121608-e7b52913fae2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw= github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20250618135814-7e3f79ab707e h1:LRT+PltY99+hxZAJn+4nyTfqGVNEM1S6FJ675B9BtJo= github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20250618135814-7e3f79ab707e/go.mod h1:jo+cUqNcHwN8IF7SInQNXDZ8qzBsyMpnLdYbDswviFc= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250522110034-65c54665034a h1:O28vgyHM7QF1YLg1BwkQSIbOYA+t0RiH9+b+k90GPG8= diff --git a/pkg/.mockery.yaml b/pkg/.mockery.yaml index b3aab4629b..d907a757f0 100644 --- a/pkg/.mockery.yaml +++ b/pkg/.mockery.yaml @@ -21,6 +21,8 @@ packages: interfaces: GasEstimator: ChainScopedConfig: + EVM: + Workflow: github.com/smartcontractkit/chainlink-evm/pkg/gas: interfaces: Config: diff --git a/pkg/chains/legacyevm/evm_txm.go b/pkg/chains/legacyevm/evm_txm.go index 4233a30361..1c5e2acc6c 100644 --- a/pkg/chains/legacyevm/evm_txm.go +++ b/pkg/chains/legacyevm/evm_txm.go @@ -2,6 +2,7 @@ package legacyevm import ( "fmt" + "time" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" @@ -40,6 +41,11 @@ func newEvmTxm( "limitDefault", cfg.GasEstimator().LimitDefault(), ) + err = validateConfirmationTimeout(cfg) + if err != nil { + return nil, err + } + if opts.GenTxManager == nil { var txmv2 txmgr.TxManager if cfg.Transactions().TransactionManagerV2().Enabled() { @@ -80,6 +86,15 @@ func newEvmTxm( return } +const maximumConfirmationTimeout = time.Second * 600 + +func validateConfirmationTimeout(cfg evmconfig.EVM) error { + if cfg.ConfirmationTimeout() > maximumConfirmationTimeout { + return fmt.Errorf("ConfirmationTimeout cannot be greater than 10 minutes, got %s", cfg.ConfirmationTimeout()) + } + return nil +} + func newGasEstimator( cfg evmconfig.EVM, client evmclient.Client, diff --git a/pkg/client/config_builder.go b/pkg/client/config_builder.go index 8e93a6dd6f..0addc9e8f4 100644 --- a/pkg/client/config_builder.go +++ b/pkg/client/config_builder.go @@ -44,6 +44,7 @@ func NewClientConfigs( noNewFinalizedHeadsThreshold time.Duration, finalizedBlockPollInterval time.Duration, newHeadsPollInterval time.Duration, + confirmationTimeout time.Duration, ) (multinode.ChainConfig, evmconfig.NodePool, []*toml.Node, error) { nodes, err := parseNodeConfigs(nodeCfgs) if err != nil { diff --git a/pkg/client/config_builder_test.go b/pkg/client/config_builder_test.go index 3eb4857202..56fcc1f2b3 100644 --- a/pkg/client/config_builder_test.go +++ b/pkg/client/config_builder_test.go @@ -27,6 +27,7 @@ func TestClientConfigBuilder(t *testing.T) { enforceRepeatableRead := ptr(true) deathDeclarationDelay := time.Second * 3 noNewFinalizedBlocksThreshold := time.Second + confirmationTimeout := time.Second * 60 nodeConfigs := []client.NodeConfig{ { Name: ptr("foo"), @@ -41,7 +42,7 @@ func TestClientConfigBuilder(t *testing.T) { chainCfg, nodePool, nodes, err := client.NewClientConfigs(selectionMode, leaseDuration, chainTypeStr, nodeConfigs, pollFailureThreshold, pollInterval, syncThreshold, nodeIsSyncingEnabled, noNewHeadsThreshold, finalityDepth, finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay, noNewFinalizedBlocksThreshold, - pollInterval, newHeadsPollInterval) + pollInterval, newHeadsPollInterval, confirmationTimeout) require.NoError(t, err) // Validate node pool configs diff --git a/pkg/client/evm_client_test.go b/pkg/client/evm_client_test.go index 1c127bf880..63b63d6f31 100644 --- a/pkg/client/evm_client_test.go +++ b/pkg/client/evm_client_test.go @@ -39,6 +39,7 @@ func TestNewEvmClient(t *testing.T) { noNewFinalizedBlocksThreshold := time.Second * 5 finalizedBlockPollInterval := time.Second * 4 newHeadsPollInterval := time.Second * 4 + confirmationTimeout := time.Second * 60 nodeConfigs := []client.NodeConfig{ { Name: ptr("foo"), @@ -51,7 +52,7 @@ func TestNewEvmClient(t *testing.T) { chainCfg, nodePool, nodes, err := client.NewClientConfigs(selectionMode, leaseDuration, chainTypeStr, nodeConfigs, pollFailureThreshold, pollInterval, syncThreshold, nodeIsSyncingEnabled, noNewHeadsThreshold, finalityDepth, finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay, noNewFinalizedBlocksThreshold, - finalizedBlockPollInterval, newHeadsPollInterval) + finalizedBlockPollInterval, newHeadsPollInterval, confirmationTimeout) require.NoError(t, err) client, err := client.NewEvmClient(nodePool, chainCfg, nil, logger.Test(t), testutils.FixtureChainID, nodes, chaintype.ChainType(chainTypeStr)) @@ -77,7 +78,7 @@ func TestChainClientMetrics(t *testing.T) { } chainCfg, nodePool, nodes, err := client.NewClientConfigs(ptr("HighestHead"), time.Duration(0), "", nodeConfigs, ptr[uint32](5), 10*time.Second, ptr[uint32](5), ptr(false), time.Minute, ptr[uint32](5), ptr(false), - ptr[uint32](5), ptr(false), 10*time.Second, 10*time.Second, 10*time.Second, 10*time.Second) + ptr[uint32](5), ptr(false), 10*time.Second, 10*time.Second, 10*time.Second, 10*time.Second, 60*time.Second) require.NoError(t, err) chainID := big.NewInt(68472) diff --git a/pkg/config/chain_scoped.go b/pkg/config/chain_scoped.go index f5d7566e94..b84861fdf8 100644 --- a/pkg/config/chain_scoped.go +++ b/pkg/config/chain_scoped.go @@ -35,6 +35,10 @@ type EVMConfig struct { C *toml.EVMConfig } +func (e *EVMConfig) ConfirmationTimeout() time.Duration { + return e.C.ConfirmationTimeout() +} + func (e *EVMConfig) IsEnabled() bool { return e.C.IsEnabled() } diff --git a/pkg/config/config.go b/pkg/config/config.go index 6f1f23c2ba..a11aef5cc4 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -51,6 +51,8 @@ type EVM interface { NodeNoNewHeadsThreshold() time.Duration FinalizedBlockOffset() uint32 NoNewFinalizedHeadsThreshold() time.Duration + // Applies to EVMService. This is the maximum amount of time we will wait for a TX to get confirmed in the chain. + ConfirmationTimeout() time.Duration IsEnabled() bool TOMLString() (string, error) diff --git a/pkg/config/mocks/evm.go b/pkg/config/mocks/evm.go new file mode 100644 index 0000000000..93c8c2c897 --- /dev/null +++ b/pkg/config/mocks/evm.go @@ -0,0 +1,1694 @@ +// Code generated by mockery v2.53.3. DO NOT EDIT. + +package mocks + +import ( + big "math/big" + + assets "github.com/smartcontractkit/chainlink-common/pkg/assets" + + chaintype "github.com/smartcontractkit/chainlink-evm/pkg/config/chaintype" + + config "github.com/smartcontractkit/chainlink-evm/pkg/config" + + mock "github.com/stretchr/testify/mock" + + time "time" +) + +// EVM is an autogenerated mock type for the EVM type +type EVM struct { + mock.Mock +} + +type EVM_Expecter struct { + mock *mock.Mock +} + +func (_m *EVM) EXPECT() *EVM_Expecter { + return &EVM_Expecter{mock: &_m.Mock} +} + +// AutoCreateKey provides a mock function with no fields +func (_m *EVM) AutoCreateKey() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AutoCreateKey") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// EVM_AutoCreateKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AutoCreateKey' +type EVM_AutoCreateKey_Call struct { + *mock.Call +} + +// AutoCreateKey is a helper method to define mock.On call +func (_e *EVM_Expecter) AutoCreateKey() *EVM_AutoCreateKey_Call { + return &EVM_AutoCreateKey_Call{Call: _e.mock.On("AutoCreateKey")} +} + +func (_c *EVM_AutoCreateKey_Call) Run(run func()) *EVM_AutoCreateKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_AutoCreateKey_Call) Return(_a0 bool) *EVM_AutoCreateKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_AutoCreateKey_Call) RunAndReturn(run func() bool) *EVM_AutoCreateKey_Call { + _c.Call.Return(run) + return _c +} + +// BackupLogPollerBlockDelay provides a mock function with no fields +func (_m *EVM) BackupLogPollerBlockDelay() uint64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for BackupLogPollerBlockDelay") + } + + var r0 uint64 + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + return r0 +} + +// EVM_BackupLogPollerBlockDelay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BackupLogPollerBlockDelay' +type EVM_BackupLogPollerBlockDelay_Call struct { + *mock.Call +} + +// BackupLogPollerBlockDelay is a helper method to define mock.On call +func (_e *EVM_Expecter) BackupLogPollerBlockDelay() *EVM_BackupLogPollerBlockDelay_Call { + return &EVM_BackupLogPollerBlockDelay_Call{Call: _e.mock.On("BackupLogPollerBlockDelay")} +} + +func (_c *EVM_BackupLogPollerBlockDelay_Call) Run(run func()) *EVM_BackupLogPollerBlockDelay_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_BackupLogPollerBlockDelay_Call) Return(_a0 uint64) *EVM_BackupLogPollerBlockDelay_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_BackupLogPollerBlockDelay_Call) RunAndReturn(run func() uint64) *EVM_BackupLogPollerBlockDelay_Call { + _c.Call.Return(run) + return _c +} + +// BalanceMonitor provides a mock function with no fields +func (_m *EVM) BalanceMonitor() config.BalanceMonitor { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for BalanceMonitor") + } + + var r0 config.BalanceMonitor + if rf, ok := ret.Get(0).(func() config.BalanceMonitor); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.BalanceMonitor) + } + } + + return r0 +} + +// EVM_BalanceMonitor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BalanceMonitor' +type EVM_BalanceMonitor_Call struct { + *mock.Call +} + +// BalanceMonitor is a helper method to define mock.On call +func (_e *EVM_Expecter) BalanceMonitor() *EVM_BalanceMonitor_Call { + return &EVM_BalanceMonitor_Call{Call: _e.mock.On("BalanceMonitor")} +} + +func (_c *EVM_BalanceMonitor_Call) Run(run func()) *EVM_BalanceMonitor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_BalanceMonitor_Call) Return(_a0 config.BalanceMonitor) *EVM_BalanceMonitor_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_BalanceMonitor_Call) RunAndReturn(run func() config.BalanceMonitor) *EVM_BalanceMonitor_Call { + _c.Call.Return(run) + return _c +} + +// BlockBackfillDepth provides a mock function with no fields +func (_m *EVM) BlockBackfillDepth() uint64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for BlockBackfillDepth") + } + + var r0 uint64 + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + return r0 +} + +// EVM_BlockBackfillDepth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockBackfillDepth' +type EVM_BlockBackfillDepth_Call struct { + *mock.Call +} + +// BlockBackfillDepth is a helper method to define mock.On call +func (_e *EVM_Expecter) BlockBackfillDepth() *EVM_BlockBackfillDepth_Call { + return &EVM_BlockBackfillDepth_Call{Call: _e.mock.On("BlockBackfillDepth")} +} + +func (_c *EVM_BlockBackfillDepth_Call) Run(run func()) *EVM_BlockBackfillDepth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_BlockBackfillDepth_Call) Return(_a0 uint64) *EVM_BlockBackfillDepth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_BlockBackfillDepth_Call) RunAndReturn(run func() uint64) *EVM_BlockBackfillDepth_Call { + _c.Call.Return(run) + return _c +} + +// BlockBackfillSkip provides a mock function with no fields +func (_m *EVM) BlockBackfillSkip() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for BlockBackfillSkip") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// EVM_BlockBackfillSkip_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockBackfillSkip' +type EVM_BlockBackfillSkip_Call struct { + *mock.Call +} + +// BlockBackfillSkip is a helper method to define mock.On call +func (_e *EVM_Expecter) BlockBackfillSkip() *EVM_BlockBackfillSkip_Call { + return &EVM_BlockBackfillSkip_Call{Call: _e.mock.On("BlockBackfillSkip")} +} + +func (_c *EVM_BlockBackfillSkip_Call) Run(run func()) *EVM_BlockBackfillSkip_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_BlockBackfillSkip_Call) Return(_a0 bool) *EVM_BlockBackfillSkip_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_BlockBackfillSkip_Call) RunAndReturn(run func() bool) *EVM_BlockBackfillSkip_Call { + _c.Call.Return(run) + return _c +} + +// BlockEmissionIdleWarningThreshold provides a mock function with no fields +func (_m *EVM) BlockEmissionIdleWarningThreshold() time.Duration { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for BlockEmissionIdleWarningThreshold") + } + + var r0 time.Duration + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + return r0 +} + +// EVM_BlockEmissionIdleWarningThreshold_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockEmissionIdleWarningThreshold' +type EVM_BlockEmissionIdleWarningThreshold_Call struct { + *mock.Call +} + +// BlockEmissionIdleWarningThreshold is a helper method to define mock.On call +func (_e *EVM_Expecter) BlockEmissionIdleWarningThreshold() *EVM_BlockEmissionIdleWarningThreshold_Call { + return &EVM_BlockEmissionIdleWarningThreshold_Call{Call: _e.mock.On("BlockEmissionIdleWarningThreshold")} +} + +func (_c *EVM_BlockEmissionIdleWarningThreshold_Call) Run(run func()) *EVM_BlockEmissionIdleWarningThreshold_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_BlockEmissionIdleWarningThreshold_Call) Return(_a0 time.Duration) *EVM_BlockEmissionIdleWarningThreshold_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_BlockEmissionIdleWarningThreshold_Call) RunAndReturn(run func() time.Duration) *EVM_BlockEmissionIdleWarningThreshold_Call { + _c.Call.Return(run) + return _c +} + +// ChainID provides a mock function with no fields +func (_m *EVM) ChainID() *big.Int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ChainID") + } + + var r0 *big.Int + if rf, ok := ret.Get(0).(func() *big.Int); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + return r0 +} + +// EVM_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' +type EVM_ChainID_Call struct { + *mock.Call +} + +// ChainID is a helper method to define mock.On call +func (_e *EVM_Expecter) ChainID() *EVM_ChainID_Call { + return &EVM_ChainID_Call{Call: _e.mock.On("ChainID")} +} + +func (_c *EVM_ChainID_Call) Run(run func()) *EVM_ChainID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_ChainID_Call) Return(_a0 *big.Int) *EVM_ChainID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_ChainID_Call) RunAndReturn(run func() *big.Int) *EVM_ChainID_Call { + _c.Call.Return(run) + return _c +} + +// ChainType provides a mock function with no fields +func (_m *EVM) ChainType() chaintype.ChainType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ChainType") + } + + var r0 chaintype.ChainType + if rf, ok := ret.Get(0).(func() chaintype.ChainType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(chaintype.ChainType) + } + + return r0 +} + +// EVM_ChainType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainType' +type EVM_ChainType_Call struct { + *mock.Call +} + +// ChainType is a helper method to define mock.On call +func (_e *EVM_Expecter) ChainType() *EVM_ChainType_Call { + return &EVM_ChainType_Call{Call: _e.mock.On("ChainType")} +} + +func (_c *EVM_ChainType_Call) Run(run func()) *EVM_ChainType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_ChainType_Call) Return(_a0 chaintype.ChainType) *EVM_ChainType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_ChainType_Call) RunAndReturn(run func() chaintype.ChainType) *EVM_ChainType_Call { + _c.Call.Return(run) + return _c +} + +// ConfirmationTimeout provides a mock function with no fields +func (_m *EVM) ConfirmationTimeout() time.Duration { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ConfirmationTimeout") + } + + var r0 time.Duration + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + return r0 +} + +// EVM_ConfirmationTimeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfirmationTimeout' +type EVM_ConfirmationTimeout_Call struct { + *mock.Call +} + +// ConfirmationTimeout is a helper method to define mock.On call +func (_e *EVM_Expecter) ConfirmationTimeout() *EVM_ConfirmationTimeout_Call { + return &EVM_ConfirmationTimeout_Call{Call: _e.mock.On("ConfirmationTimeout")} +} + +func (_c *EVM_ConfirmationTimeout_Call) Run(run func()) *EVM_ConfirmationTimeout_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_ConfirmationTimeout_Call) Return(_a0 time.Duration) *EVM_ConfirmationTimeout_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_ConfirmationTimeout_Call) RunAndReturn(run func() time.Duration) *EVM_ConfirmationTimeout_Call { + _c.Call.Return(run) + return _c +} + +// FinalityDepth provides a mock function with no fields +func (_m *EVM) FinalityDepth() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for FinalityDepth") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// EVM_FinalityDepth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalityDepth' +type EVM_FinalityDepth_Call struct { + *mock.Call +} + +// FinalityDepth is a helper method to define mock.On call +func (_e *EVM_Expecter) FinalityDepth() *EVM_FinalityDepth_Call { + return &EVM_FinalityDepth_Call{Call: _e.mock.On("FinalityDepth")} +} + +func (_c *EVM_FinalityDepth_Call) Run(run func()) *EVM_FinalityDepth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_FinalityDepth_Call) Return(_a0 uint32) *EVM_FinalityDepth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_FinalityDepth_Call) RunAndReturn(run func() uint32) *EVM_FinalityDepth_Call { + _c.Call.Return(run) + return _c +} + +// FinalityTagEnabled provides a mock function with no fields +func (_m *EVM) FinalityTagEnabled() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for FinalityTagEnabled") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// EVM_FinalityTagEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalityTagEnabled' +type EVM_FinalityTagEnabled_Call struct { + *mock.Call +} + +// FinalityTagEnabled is a helper method to define mock.On call +func (_e *EVM_Expecter) FinalityTagEnabled() *EVM_FinalityTagEnabled_Call { + return &EVM_FinalityTagEnabled_Call{Call: _e.mock.On("FinalityTagEnabled")} +} + +func (_c *EVM_FinalityTagEnabled_Call) Run(run func()) *EVM_FinalityTagEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_FinalityTagEnabled_Call) Return(_a0 bool) *EVM_FinalityTagEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_FinalityTagEnabled_Call) RunAndReturn(run func() bool) *EVM_FinalityTagEnabled_Call { + _c.Call.Return(run) + return _c +} + +// FinalizedBlockOffset provides a mock function with no fields +func (_m *EVM) FinalizedBlockOffset() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for FinalizedBlockOffset") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// EVM_FinalizedBlockOffset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizedBlockOffset' +type EVM_FinalizedBlockOffset_Call struct { + *mock.Call +} + +// FinalizedBlockOffset is a helper method to define mock.On call +func (_e *EVM_Expecter) FinalizedBlockOffset() *EVM_FinalizedBlockOffset_Call { + return &EVM_FinalizedBlockOffset_Call{Call: _e.mock.On("FinalizedBlockOffset")} +} + +func (_c *EVM_FinalizedBlockOffset_Call) Run(run func()) *EVM_FinalizedBlockOffset_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_FinalizedBlockOffset_Call) Return(_a0 uint32) *EVM_FinalizedBlockOffset_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_FinalizedBlockOffset_Call) RunAndReturn(run func() uint32) *EVM_FinalizedBlockOffset_Call { + _c.Call.Return(run) + return _c +} + +// FlagsContractAddress provides a mock function with no fields +func (_m *EVM) FlagsContractAddress() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for FlagsContractAddress") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// EVM_FlagsContractAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FlagsContractAddress' +type EVM_FlagsContractAddress_Call struct { + *mock.Call +} + +// FlagsContractAddress is a helper method to define mock.On call +func (_e *EVM_Expecter) FlagsContractAddress() *EVM_FlagsContractAddress_Call { + return &EVM_FlagsContractAddress_Call{Call: _e.mock.On("FlagsContractAddress")} +} + +func (_c *EVM_FlagsContractAddress_Call) Run(run func()) *EVM_FlagsContractAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_FlagsContractAddress_Call) Return(_a0 string) *EVM_FlagsContractAddress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_FlagsContractAddress_Call) RunAndReturn(run func() string) *EVM_FlagsContractAddress_Call { + _c.Call.Return(run) + return _c +} + +// GasEstimator provides a mock function with no fields +func (_m *EVM) GasEstimator() config.GasEstimator { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GasEstimator") + } + + var r0 config.GasEstimator + if rf, ok := ret.Get(0).(func() config.GasEstimator); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.GasEstimator) + } + } + + return r0 +} + +// EVM_GasEstimator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GasEstimator' +type EVM_GasEstimator_Call struct { + *mock.Call +} + +// GasEstimator is a helper method to define mock.On call +func (_e *EVM_Expecter) GasEstimator() *EVM_GasEstimator_Call { + return &EVM_GasEstimator_Call{Call: _e.mock.On("GasEstimator")} +} + +func (_c *EVM_GasEstimator_Call) Run(run func()) *EVM_GasEstimator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_GasEstimator_Call) Return(_a0 config.GasEstimator) *EVM_GasEstimator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_GasEstimator_Call) RunAndReturn(run func() config.GasEstimator) *EVM_GasEstimator_Call { + _c.Call.Return(run) + return _c +} + +// HeadTracker provides a mock function with no fields +func (_m *EVM) HeadTracker() config.HeadTracker { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HeadTracker") + } + + var r0 config.HeadTracker + if rf, ok := ret.Get(0).(func() config.HeadTracker); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.HeadTracker) + } + } + + return r0 +} + +// EVM_HeadTracker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeadTracker' +type EVM_HeadTracker_Call struct { + *mock.Call +} + +// HeadTracker is a helper method to define mock.On call +func (_e *EVM_Expecter) HeadTracker() *EVM_HeadTracker_Call { + return &EVM_HeadTracker_Call{Call: _e.mock.On("HeadTracker")} +} + +func (_c *EVM_HeadTracker_Call) Run(run func()) *EVM_HeadTracker_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_HeadTracker_Call) Return(_a0 config.HeadTracker) *EVM_HeadTracker_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_HeadTracker_Call) RunAndReturn(run func() config.HeadTracker) *EVM_HeadTracker_Call { + _c.Call.Return(run) + return _c +} + +// IsEnabled provides a mock function with no fields +func (_m *EVM) IsEnabled() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsEnabled") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// EVM_IsEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsEnabled' +type EVM_IsEnabled_Call struct { + *mock.Call +} + +// IsEnabled is a helper method to define mock.On call +func (_e *EVM_Expecter) IsEnabled() *EVM_IsEnabled_Call { + return &EVM_IsEnabled_Call{Call: _e.mock.On("IsEnabled")} +} + +func (_c *EVM_IsEnabled_Call) Run(run func()) *EVM_IsEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_IsEnabled_Call) Return(_a0 bool) *EVM_IsEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_IsEnabled_Call) RunAndReturn(run func() bool) *EVM_IsEnabled_Call { + _c.Call.Return(run) + return _c +} + +// LinkContractAddress provides a mock function with no fields +func (_m *EVM) LinkContractAddress() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LinkContractAddress") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// EVM_LinkContractAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkContractAddress' +type EVM_LinkContractAddress_Call struct { + *mock.Call +} + +// LinkContractAddress is a helper method to define mock.On call +func (_e *EVM_Expecter) LinkContractAddress() *EVM_LinkContractAddress_Call { + return &EVM_LinkContractAddress_Call{Call: _e.mock.On("LinkContractAddress")} +} + +func (_c *EVM_LinkContractAddress_Call) Run(run func()) *EVM_LinkContractAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_LinkContractAddress_Call) Return(_a0 string) *EVM_LinkContractAddress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_LinkContractAddress_Call) RunAndReturn(run func() string) *EVM_LinkContractAddress_Call { + _c.Call.Return(run) + return _c +} + +// LogBackfillBatchSize provides a mock function with no fields +func (_m *EVM) LogBackfillBatchSize() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LogBackfillBatchSize") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// EVM_LogBackfillBatchSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogBackfillBatchSize' +type EVM_LogBackfillBatchSize_Call struct { + *mock.Call +} + +// LogBackfillBatchSize is a helper method to define mock.On call +func (_e *EVM_Expecter) LogBackfillBatchSize() *EVM_LogBackfillBatchSize_Call { + return &EVM_LogBackfillBatchSize_Call{Call: _e.mock.On("LogBackfillBatchSize")} +} + +func (_c *EVM_LogBackfillBatchSize_Call) Run(run func()) *EVM_LogBackfillBatchSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_LogBackfillBatchSize_Call) Return(_a0 uint32) *EVM_LogBackfillBatchSize_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_LogBackfillBatchSize_Call) RunAndReturn(run func() uint32) *EVM_LogBackfillBatchSize_Call { + _c.Call.Return(run) + return _c +} + +// LogBroadcasterEnabled provides a mock function with no fields +func (_m *EVM) LogBroadcasterEnabled() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LogBroadcasterEnabled") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// EVM_LogBroadcasterEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogBroadcasterEnabled' +type EVM_LogBroadcasterEnabled_Call struct { + *mock.Call +} + +// LogBroadcasterEnabled is a helper method to define mock.On call +func (_e *EVM_Expecter) LogBroadcasterEnabled() *EVM_LogBroadcasterEnabled_Call { + return &EVM_LogBroadcasterEnabled_Call{Call: _e.mock.On("LogBroadcasterEnabled")} +} + +func (_c *EVM_LogBroadcasterEnabled_Call) Run(run func()) *EVM_LogBroadcasterEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_LogBroadcasterEnabled_Call) Return(_a0 bool) *EVM_LogBroadcasterEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_LogBroadcasterEnabled_Call) RunAndReturn(run func() bool) *EVM_LogBroadcasterEnabled_Call { + _c.Call.Return(run) + return _c +} + +// LogKeepBlocksDepth provides a mock function with no fields +func (_m *EVM) LogKeepBlocksDepth() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LogKeepBlocksDepth") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// EVM_LogKeepBlocksDepth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogKeepBlocksDepth' +type EVM_LogKeepBlocksDepth_Call struct { + *mock.Call +} + +// LogKeepBlocksDepth is a helper method to define mock.On call +func (_e *EVM_Expecter) LogKeepBlocksDepth() *EVM_LogKeepBlocksDepth_Call { + return &EVM_LogKeepBlocksDepth_Call{Call: _e.mock.On("LogKeepBlocksDepth")} +} + +func (_c *EVM_LogKeepBlocksDepth_Call) Run(run func()) *EVM_LogKeepBlocksDepth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_LogKeepBlocksDepth_Call) Return(_a0 uint32) *EVM_LogKeepBlocksDepth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_LogKeepBlocksDepth_Call) RunAndReturn(run func() uint32) *EVM_LogKeepBlocksDepth_Call { + _c.Call.Return(run) + return _c +} + +// LogPollInterval provides a mock function with no fields +func (_m *EVM) LogPollInterval() time.Duration { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LogPollInterval") + } + + var r0 time.Duration + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + return r0 +} + +// EVM_LogPollInterval_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogPollInterval' +type EVM_LogPollInterval_Call struct { + *mock.Call +} + +// LogPollInterval is a helper method to define mock.On call +func (_e *EVM_Expecter) LogPollInterval() *EVM_LogPollInterval_Call { + return &EVM_LogPollInterval_Call{Call: _e.mock.On("LogPollInterval")} +} + +func (_c *EVM_LogPollInterval_Call) Run(run func()) *EVM_LogPollInterval_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_LogPollInterval_Call) Return(_a0 time.Duration) *EVM_LogPollInterval_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_LogPollInterval_Call) RunAndReturn(run func() time.Duration) *EVM_LogPollInterval_Call { + _c.Call.Return(run) + return _c +} + +// LogPrunePageSize provides a mock function with no fields +func (_m *EVM) LogPrunePageSize() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LogPrunePageSize") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// EVM_LogPrunePageSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogPrunePageSize' +type EVM_LogPrunePageSize_Call struct { + *mock.Call +} + +// LogPrunePageSize is a helper method to define mock.On call +func (_e *EVM_Expecter) LogPrunePageSize() *EVM_LogPrunePageSize_Call { + return &EVM_LogPrunePageSize_Call{Call: _e.mock.On("LogPrunePageSize")} +} + +func (_c *EVM_LogPrunePageSize_Call) Run(run func()) *EVM_LogPrunePageSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_LogPrunePageSize_Call) Return(_a0 uint32) *EVM_LogPrunePageSize_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_LogPrunePageSize_Call) RunAndReturn(run func() uint32) *EVM_LogPrunePageSize_Call { + _c.Call.Return(run) + return _c +} + +// MinContractPayment provides a mock function with no fields +func (_m *EVM) MinContractPayment() *assets.Link { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MinContractPayment") + } + + var r0 *assets.Link + if rf, ok := ret.Get(0).(func() *assets.Link); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*assets.Link) + } + } + + return r0 +} + +// EVM_MinContractPayment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MinContractPayment' +type EVM_MinContractPayment_Call struct { + *mock.Call +} + +// MinContractPayment is a helper method to define mock.On call +func (_e *EVM_Expecter) MinContractPayment() *EVM_MinContractPayment_Call { + return &EVM_MinContractPayment_Call{Call: _e.mock.On("MinContractPayment")} +} + +func (_c *EVM_MinContractPayment_Call) Run(run func()) *EVM_MinContractPayment_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_MinContractPayment_Call) Return(_a0 *assets.Link) *EVM_MinContractPayment_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_MinContractPayment_Call) RunAndReturn(run func() *assets.Link) *EVM_MinContractPayment_Call { + _c.Call.Return(run) + return _c +} + +// MinIncomingConfirmations provides a mock function with no fields +func (_m *EVM) MinIncomingConfirmations() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MinIncomingConfirmations") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// EVM_MinIncomingConfirmations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MinIncomingConfirmations' +type EVM_MinIncomingConfirmations_Call struct { + *mock.Call +} + +// MinIncomingConfirmations is a helper method to define mock.On call +func (_e *EVM_Expecter) MinIncomingConfirmations() *EVM_MinIncomingConfirmations_Call { + return &EVM_MinIncomingConfirmations_Call{Call: _e.mock.On("MinIncomingConfirmations")} +} + +func (_c *EVM_MinIncomingConfirmations_Call) Run(run func()) *EVM_MinIncomingConfirmations_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_MinIncomingConfirmations_Call) Return(_a0 uint32) *EVM_MinIncomingConfirmations_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_MinIncomingConfirmations_Call) RunAndReturn(run func() uint32) *EVM_MinIncomingConfirmations_Call { + _c.Call.Return(run) + return _c +} + +// NoNewFinalizedHeadsThreshold provides a mock function with no fields +func (_m *EVM) NoNewFinalizedHeadsThreshold() time.Duration { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NoNewFinalizedHeadsThreshold") + } + + var r0 time.Duration + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + return r0 +} + +// EVM_NoNewFinalizedHeadsThreshold_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NoNewFinalizedHeadsThreshold' +type EVM_NoNewFinalizedHeadsThreshold_Call struct { + *mock.Call +} + +// NoNewFinalizedHeadsThreshold is a helper method to define mock.On call +func (_e *EVM_Expecter) NoNewFinalizedHeadsThreshold() *EVM_NoNewFinalizedHeadsThreshold_Call { + return &EVM_NoNewFinalizedHeadsThreshold_Call{Call: _e.mock.On("NoNewFinalizedHeadsThreshold")} +} + +func (_c *EVM_NoNewFinalizedHeadsThreshold_Call) Run(run func()) *EVM_NoNewFinalizedHeadsThreshold_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_NoNewFinalizedHeadsThreshold_Call) Return(_a0 time.Duration) *EVM_NoNewFinalizedHeadsThreshold_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_NoNewFinalizedHeadsThreshold_Call) RunAndReturn(run func() time.Duration) *EVM_NoNewFinalizedHeadsThreshold_Call { + _c.Call.Return(run) + return _c +} + +// NodeNoNewHeadsThreshold provides a mock function with no fields +func (_m *EVM) NodeNoNewHeadsThreshold() time.Duration { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NodeNoNewHeadsThreshold") + } + + var r0 time.Duration + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + return r0 +} + +// EVM_NodeNoNewHeadsThreshold_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeNoNewHeadsThreshold' +type EVM_NodeNoNewHeadsThreshold_Call struct { + *mock.Call +} + +// NodeNoNewHeadsThreshold is a helper method to define mock.On call +func (_e *EVM_Expecter) NodeNoNewHeadsThreshold() *EVM_NodeNoNewHeadsThreshold_Call { + return &EVM_NodeNoNewHeadsThreshold_Call{Call: _e.mock.On("NodeNoNewHeadsThreshold")} +} + +func (_c *EVM_NodeNoNewHeadsThreshold_Call) Run(run func()) *EVM_NodeNoNewHeadsThreshold_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_NodeNoNewHeadsThreshold_Call) Return(_a0 time.Duration) *EVM_NodeNoNewHeadsThreshold_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_NodeNoNewHeadsThreshold_Call) RunAndReturn(run func() time.Duration) *EVM_NodeNoNewHeadsThreshold_Call { + _c.Call.Return(run) + return _c +} + +// NodePool provides a mock function with no fields +func (_m *EVM) NodePool() config.NodePool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NodePool") + } + + var r0 config.NodePool + if rf, ok := ret.Get(0).(func() config.NodePool); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.NodePool) + } + } + + return r0 +} + +// EVM_NodePool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodePool' +type EVM_NodePool_Call struct { + *mock.Call +} + +// NodePool is a helper method to define mock.On call +func (_e *EVM_Expecter) NodePool() *EVM_NodePool_Call { + return &EVM_NodePool_Call{Call: _e.mock.On("NodePool")} +} + +func (_c *EVM_NodePool_Call) Run(run func()) *EVM_NodePool_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_NodePool_Call) Return(_a0 config.NodePool) *EVM_NodePool_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_NodePool_Call) RunAndReturn(run func() config.NodePool) *EVM_NodePool_Call { + _c.Call.Return(run) + return _c +} + +// NonceAutoSync provides a mock function with no fields +func (_m *EVM) NonceAutoSync() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NonceAutoSync") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// EVM_NonceAutoSync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NonceAutoSync' +type EVM_NonceAutoSync_Call struct { + *mock.Call +} + +// NonceAutoSync is a helper method to define mock.On call +func (_e *EVM_Expecter) NonceAutoSync() *EVM_NonceAutoSync_Call { + return &EVM_NonceAutoSync_Call{Call: _e.mock.On("NonceAutoSync")} +} + +func (_c *EVM_NonceAutoSync_Call) Run(run func()) *EVM_NonceAutoSync_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_NonceAutoSync_Call) Return(_a0 bool) *EVM_NonceAutoSync_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_NonceAutoSync_Call) RunAndReturn(run func() bool) *EVM_NonceAutoSync_Call { + _c.Call.Return(run) + return _c +} + +// OCR provides a mock function with no fields +func (_m *EVM) OCR() config.OCR { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for OCR") + } + + var r0 config.OCR + if rf, ok := ret.Get(0).(func() config.OCR); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.OCR) + } + } + + return r0 +} + +// EVM_OCR_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OCR' +type EVM_OCR_Call struct { + *mock.Call +} + +// OCR is a helper method to define mock.On call +func (_e *EVM_Expecter) OCR() *EVM_OCR_Call { + return &EVM_OCR_Call{Call: _e.mock.On("OCR")} +} + +func (_c *EVM_OCR_Call) Run(run func()) *EVM_OCR_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_OCR_Call) Return(_a0 config.OCR) *EVM_OCR_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_OCR_Call) RunAndReturn(run func() config.OCR) *EVM_OCR_Call { + _c.Call.Return(run) + return _c +} + +// OCR2 provides a mock function with no fields +func (_m *EVM) OCR2() config.OCR2 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for OCR2") + } + + var r0 config.OCR2 + if rf, ok := ret.Get(0).(func() config.OCR2); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.OCR2) + } + } + + return r0 +} + +// EVM_OCR2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OCR2' +type EVM_OCR2_Call struct { + *mock.Call +} + +// OCR2 is a helper method to define mock.On call +func (_e *EVM_Expecter) OCR2() *EVM_OCR2_Call { + return &EVM_OCR2_Call{Call: _e.mock.On("OCR2")} +} + +func (_c *EVM_OCR2_Call) Run(run func()) *EVM_OCR2_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_OCR2_Call) Return(_a0 config.OCR2) *EVM_OCR2_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_OCR2_Call) RunAndReturn(run func() config.OCR2) *EVM_OCR2_Call { + _c.Call.Return(run) + return _c +} + +// OperatorFactoryAddress provides a mock function with no fields +func (_m *EVM) OperatorFactoryAddress() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for OperatorFactoryAddress") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// EVM_OperatorFactoryAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OperatorFactoryAddress' +type EVM_OperatorFactoryAddress_Call struct { + *mock.Call +} + +// OperatorFactoryAddress is a helper method to define mock.On call +func (_e *EVM_Expecter) OperatorFactoryAddress() *EVM_OperatorFactoryAddress_Call { + return &EVM_OperatorFactoryAddress_Call{Call: _e.mock.On("OperatorFactoryAddress")} +} + +func (_c *EVM_OperatorFactoryAddress_Call) Run(run func()) *EVM_OperatorFactoryAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_OperatorFactoryAddress_Call) Return(_a0 string) *EVM_OperatorFactoryAddress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_OperatorFactoryAddress_Call) RunAndReturn(run func() string) *EVM_OperatorFactoryAddress_Call { + _c.Call.Return(run) + return _c +} + +// RPCDefaultBatchSize provides a mock function with no fields +func (_m *EVM) RPCDefaultBatchSize() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for RPCDefaultBatchSize") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// EVM_RPCDefaultBatchSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RPCDefaultBatchSize' +type EVM_RPCDefaultBatchSize_Call struct { + *mock.Call +} + +// RPCDefaultBatchSize is a helper method to define mock.On call +func (_e *EVM_Expecter) RPCDefaultBatchSize() *EVM_RPCDefaultBatchSize_Call { + return &EVM_RPCDefaultBatchSize_Call{Call: _e.mock.On("RPCDefaultBatchSize")} +} + +func (_c *EVM_RPCDefaultBatchSize_Call) Run(run func()) *EVM_RPCDefaultBatchSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_RPCDefaultBatchSize_Call) Return(_a0 uint32) *EVM_RPCDefaultBatchSize_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_RPCDefaultBatchSize_Call) RunAndReturn(run func() uint32) *EVM_RPCDefaultBatchSize_Call { + _c.Call.Return(run) + return _c +} + +// SafeDepth provides a mock function with no fields +func (_m *EVM) SafeDepth() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for SafeDepth") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// EVM_SafeDepth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SafeDepth' +type EVM_SafeDepth_Call struct { + *mock.Call +} + +// SafeDepth is a helper method to define mock.On call +func (_e *EVM_Expecter) SafeDepth() *EVM_SafeDepth_Call { + return &EVM_SafeDepth_Call{Call: _e.mock.On("SafeDepth")} +} + +func (_c *EVM_SafeDepth_Call) Run(run func()) *EVM_SafeDepth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_SafeDepth_Call) Return(_a0 uint32) *EVM_SafeDepth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_SafeDepth_Call) RunAndReturn(run func() uint32) *EVM_SafeDepth_Call { + _c.Call.Return(run) + return _c +} + +// TOMLString provides a mock function with no fields +func (_m *EVM) TOMLString() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for TOMLString") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM_TOMLString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TOMLString' +type EVM_TOMLString_Call struct { + *mock.Call +} + +// TOMLString is a helper method to define mock.On call +func (_e *EVM_Expecter) TOMLString() *EVM_TOMLString_Call { + return &EVM_TOMLString_Call{Call: _e.mock.On("TOMLString")} +} + +func (_c *EVM_TOMLString_Call) Run(run func()) *EVM_TOMLString_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_TOMLString_Call) Return(_a0 string, _a1 error) *EVM_TOMLString_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM_TOMLString_Call) RunAndReturn(run func() (string, error)) *EVM_TOMLString_Call { + _c.Call.Return(run) + return _c +} + +// Transactions provides a mock function with no fields +func (_m *EVM) Transactions() config.Transactions { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Transactions") + } + + var r0 config.Transactions + if rf, ok := ret.Get(0).(func() config.Transactions); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.Transactions) + } + } + + return r0 +} + +// EVM_Transactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transactions' +type EVM_Transactions_Call struct { + *mock.Call +} + +// Transactions is a helper method to define mock.On call +func (_e *EVM_Expecter) Transactions() *EVM_Transactions_Call { + return &EVM_Transactions_Call{Call: _e.mock.On("Transactions")} +} + +func (_c *EVM_Transactions_Call) Run(run func()) *EVM_Transactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_Transactions_Call) Return(_a0 config.Transactions) *EVM_Transactions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_Transactions_Call) RunAndReturn(run func() config.Transactions) *EVM_Transactions_Call { + _c.Call.Return(run) + return _c +} + +// Workflow provides a mock function with no fields +func (_m *EVM) Workflow() config.Workflow { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Workflow") + } + + var r0 config.Workflow + if rf, ok := ret.Get(0).(func() config.Workflow); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.Workflow) + } + } + + return r0 +} + +// EVM_Workflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Workflow' +type EVM_Workflow_Call struct { + *mock.Call +} + +// Workflow is a helper method to define mock.On call +func (_e *EVM_Expecter) Workflow() *EVM_Workflow_Call { + return &EVM_Workflow_Call{Call: _e.mock.On("Workflow")} +} + +func (_c *EVM_Workflow_Call) Run(run func()) *EVM_Workflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM_Workflow_Call) Return(_a0 config.Workflow) *EVM_Workflow_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM_Workflow_Call) RunAndReturn(run func() config.Workflow) *EVM_Workflow_Call { + _c.Call.Return(run) + return _c +} + +// NewEVM creates a new instance of EVM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEVM(t interface { + mock.TestingT + Cleanup(func()) +}) *EVM { + mock := &EVM{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/config/mocks/workflow.go b/pkg/config/mocks/workflow.go new file mode 100644 index 0000000000..2f61c8b394 --- /dev/null +++ b/pkg/config/mocks/workflow.go @@ -0,0 +1,317 @@ +// Code generated by mockery v2.53.3. DO NOT EDIT. + +package mocks + +import ( + time "time" + + pkgtypes "github.com/smartcontractkit/chainlink-common/pkg/types" + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink-evm/pkg/types" +) + +// Workflow is an autogenerated mock type for the Workflow type +type Workflow struct { + mock.Mock +} + +type Workflow_Expecter struct { + mock *mock.Mock +} + +func (_m *Workflow) EXPECT() *Workflow_Expecter { + return &Workflow_Expecter{mock: &_m.Mock} +} + +// AcceptanceTimeout provides a mock function with no fields +func (_m *Workflow) AcceptanceTimeout() time.Duration { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AcceptanceTimeout") + } + + var r0 time.Duration + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + return r0 +} + +// Workflow_AcceptanceTimeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptanceTimeout' +type Workflow_AcceptanceTimeout_Call struct { + *mock.Call +} + +// AcceptanceTimeout is a helper method to define mock.On call +func (_e *Workflow_Expecter) AcceptanceTimeout() *Workflow_AcceptanceTimeout_Call { + return &Workflow_AcceptanceTimeout_Call{Call: _e.mock.On("AcceptanceTimeout")} +} + +func (_c *Workflow_AcceptanceTimeout_Call) Run(run func()) *Workflow_AcceptanceTimeout_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Workflow_AcceptanceTimeout_Call) Return(_a0 time.Duration) *Workflow_AcceptanceTimeout_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Workflow_AcceptanceTimeout_Call) RunAndReturn(run func() time.Duration) *Workflow_AcceptanceTimeout_Call { + _c.Call.Return(run) + return _c +} + +// ForwarderAddress provides a mock function with no fields +func (_m *Workflow) ForwarderAddress() *types.EIP55Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ForwarderAddress") + } + + var r0 *types.EIP55Address + if rf, ok := ret.Get(0).(func() *types.EIP55Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.EIP55Address) + } + } + + return r0 +} + +// Workflow_ForwarderAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForwarderAddress' +type Workflow_ForwarderAddress_Call struct { + *mock.Call +} + +// ForwarderAddress is a helper method to define mock.On call +func (_e *Workflow_Expecter) ForwarderAddress() *Workflow_ForwarderAddress_Call { + return &Workflow_ForwarderAddress_Call{Call: _e.mock.On("ForwarderAddress")} +} + +func (_c *Workflow_ForwarderAddress_Call) Run(run func()) *Workflow_ForwarderAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Workflow_ForwarderAddress_Call) Return(_a0 *types.EIP55Address) *Workflow_ForwarderAddress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Workflow_ForwarderAddress_Call) RunAndReturn(run func() *types.EIP55Address) *Workflow_ForwarderAddress_Call { + _c.Call.Return(run) + return _c +} + +// FromAddress provides a mock function with no fields +func (_m *Workflow) FromAddress() *types.EIP55Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for FromAddress") + } + + var r0 *types.EIP55Address + if rf, ok := ret.Get(0).(func() *types.EIP55Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.EIP55Address) + } + } + + return r0 +} + +// Workflow_FromAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FromAddress' +type Workflow_FromAddress_Call struct { + *mock.Call +} + +// FromAddress is a helper method to define mock.On call +func (_e *Workflow_Expecter) FromAddress() *Workflow_FromAddress_Call { + return &Workflow_FromAddress_Call{Call: _e.mock.On("FromAddress")} +} + +func (_c *Workflow_FromAddress_Call) Run(run func()) *Workflow_FromAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Workflow_FromAddress_Call) Return(_a0 *types.EIP55Address) *Workflow_FromAddress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Workflow_FromAddress_Call) RunAndReturn(run func() *types.EIP55Address) *Workflow_FromAddress_Call { + _c.Call.Return(run) + return _c +} + +// GasLimitDefault provides a mock function with no fields +func (_m *Workflow) GasLimitDefault() *uint64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GasLimitDefault") + } + + var r0 *uint64 + if rf, ok := ret.Get(0).(func() *uint64); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*uint64) + } + } + + return r0 +} + +// Workflow_GasLimitDefault_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GasLimitDefault' +type Workflow_GasLimitDefault_Call struct { + *mock.Call +} + +// GasLimitDefault is a helper method to define mock.On call +func (_e *Workflow_Expecter) GasLimitDefault() *Workflow_GasLimitDefault_Call { + return &Workflow_GasLimitDefault_Call{Call: _e.mock.On("GasLimitDefault")} +} + +func (_c *Workflow_GasLimitDefault_Call) Run(run func()) *Workflow_GasLimitDefault_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Workflow_GasLimitDefault_Call) Return(_a0 *uint64) *Workflow_GasLimitDefault_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Workflow_GasLimitDefault_Call) RunAndReturn(run func() *uint64) *Workflow_GasLimitDefault_Call { + _c.Call.Return(run) + return _c +} + +// PollPeriod provides a mock function with no fields +func (_m *Workflow) PollPeriod() time.Duration { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for PollPeriod") + } + + var r0 time.Duration + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + return r0 +} + +// Workflow_PollPeriod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PollPeriod' +type Workflow_PollPeriod_Call struct { + *mock.Call +} + +// PollPeriod is a helper method to define mock.On call +func (_e *Workflow_Expecter) PollPeriod() *Workflow_PollPeriod_Call { + return &Workflow_PollPeriod_Call{Call: _e.mock.On("PollPeriod")} +} + +func (_c *Workflow_PollPeriod_Call) Run(run func()) *Workflow_PollPeriod_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Workflow_PollPeriod_Call) Return(_a0 time.Duration) *Workflow_PollPeriod_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Workflow_PollPeriod_Call) RunAndReturn(run func() time.Duration) *Workflow_PollPeriod_Call { + _c.Call.Return(run) + return _c +} + +// TxAcceptanceState provides a mock function with no fields +func (_m *Workflow) TxAcceptanceState() *pkgtypes.TransactionStatus { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for TxAcceptanceState") + } + + var r0 *pkgtypes.TransactionStatus + if rf, ok := ret.Get(0).(func() *pkgtypes.TransactionStatus); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pkgtypes.TransactionStatus) + } + } + + return r0 +} + +// Workflow_TxAcceptanceState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TxAcceptanceState' +type Workflow_TxAcceptanceState_Call struct { + *mock.Call +} + +// TxAcceptanceState is a helper method to define mock.On call +func (_e *Workflow_Expecter) TxAcceptanceState() *Workflow_TxAcceptanceState_Call { + return &Workflow_TxAcceptanceState_Call{Call: _e.mock.On("TxAcceptanceState")} +} + +func (_c *Workflow_TxAcceptanceState_Call) Run(run func()) *Workflow_TxAcceptanceState_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Workflow_TxAcceptanceState_Call) Return(_a0 *pkgtypes.TransactionStatus) *Workflow_TxAcceptanceState_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Workflow_TxAcceptanceState_Call) RunAndReturn(run func() *pkgtypes.TransactionStatus) *Workflow_TxAcceptanceState_Call { + _c.Call.Return(run) + return _c +} + +// NewWorkflow creates a new instance of Workflow. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWorkflow(t interface { + mock.TestingT + Cleanup(func()) +}) *Workflow { + mock := &Workflow{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/config/toml/config.go b/pkg/config/toml/config.go index 03d1ee3ade..10dd1c16d9 100644 --- a/pkg/config/toml/config.go +++ b/pkg/config/toml/config.go @@ -296,6 +296,10 @@ type EVMConfig struct { Nodes EVMNodes } +func (c *EVMConfig) ConfirmationTimeout() time.Duration { + return c.Chain.Transactions.ConfirmationTimeout.Duration() +} + func (c *EVMConfig) IsEnabled() bool { return c.Enabled == nil || *c.Enabled } @@ -522,6 +526,7 @@ type Transactions struct { ReaperInterval *commonconfig.Duration ReaperThreshold *commonconfig.Duration ResendAfterThreshold *commonconfig.Duration + ConfirmationTimeout *commonconfig.Duration AutoPurge AutoPurgeConfig `toml:",omitempty"` TransactionManagerV2 TransactionManagerV2Config `toml:",omitempty"` @@ -549,6 +554,9 @@ func (t *Transactions) setFrom(f *Transactions) { if v := f.ResendAfterThreshold; v != nil { t.ResendAfterThreshold = v } + if v := f.ConfirmationTimeout; v != nil { + t.ConfirmationTimeout = v + } t.AutoPurge.setFrom(&f.AutoPurge) t.TransactionManagerV2.setFrom(&f.TransactionManagerV2) } diff --git a/pkg/config/toml/config_test.go b/pkg/config/toml/config_test.go index 4f7988d16b..48cd70ab1c 100644 --- a/pkg/config/toml/config_test.go +++ b/pkg/config/toml/config_test.go @@ -278,6 +278,7 @@ var fullConfig = EVMConfig{ ReaperInterval: config.MustNewDuration(time.Minute), ReaperThreshold: config.MustNewDuration(time.Minute), ResendAfterThreshold: config.MustNewDuration(time.Hour), + ConfirmationTimeout: config.MustNewDuration(time.Minute), ForwardersEnabled: ptr(true), AutoPurge: AutoPurgeConfig{ Enabled: ptr(false), diff --git a/pkg/config/toml/defaults/Ethereum_Mainnet.toml b/pkg/config/toml/defaults/Ethereum_Mainnet.toml index 984150c694..5fb9506d35 100644 --- a/pkg/config/toml/defaults/Ethereum_Mainnet.toml +++ b/pkg/config/toml/defaults/Ethereum_Mainnet.toml @@ -5,6 +5,9 @@ MinContractPayment = '0.1 link' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' NoNewFinalizedHeadsThreshold = '9m' +[Transactions] +ConfirmationTimeout = '5m0s' + [GasEstimator] EIP1559DynamicFees = true diff --git a/pkg/config/toml/defaults/fallback.toml b/pkg/config/toml/defaults/fallback.toml index 6b125a62bb..e0d1acb68b 100644 --- a/pkg/config/toml/defaults/fallback.toml +++ b/pkg/config/toml/defaults/fallback.toml @@ -20,6 +20,7 @@ NoNewFinalizedHeadsThreshold = '0' LogBroadcasterEnabled = true [Transactions] +ConfirmationTimeout = '1m0s' Enabled = true ForwardersEnabled = false MaxInFlight = 16 diff --git a/pkg/config/toml/docs.toml b/pkg/config/toml/docs.toml index 8673aa19e0..9c69450053 100644 --- a/pkg/config/toml/docs.toml +++ b/pkg/config/toml/docs.toml @@ -120,6 +120,8 @@ LogBroadcasterEnabled = true # Default NoNewFinalizedHeadsThreshold = '0' # Default [Transactions] +# ConfirmationTimeout time to wait for a TX to get into a block in the blockchain. This is used for the EVMService.SubmitTransaction operation. +ConfirmationTimeout = '60s' # Default # Enabled is a feature flag for the Transaction Manager. This flag also enables or disables the gas estimator since it is dependent on the TXM to start it. Enabled = true # Default # ForwardersEnabled enables or disables sending transactions through forwarder contracts. diff --git a/pkg/config/toml/testdata/config-full.toml b/pkg/config/toml/testdata/config-full.toml index 5002dbe098..3f1138c8fd 100644 --- a/pkg/config/toml/testdata/config-full.toml +++ b/pkg/config/toml/testdata/config-full.toml @@ -33,6 +33,7 @@ MaxQueued = 99 ReaperInterval = '1m0s' ReaperThreshold = '1m0s' ResendAfterThreshold = '1h0m0s' +ConfirmationTimeout = '1m0s' [Transactions.AutoPurge] Enabled = false diff --git a/pkg/txm/orchestrator.go b/pkg/txm/orchestrator.go index 99437e3b7f..13f0ff05c2 100644 --- a/pkg/txm/orchestrator.go +++ b/pkg/txm/orchestrator.go @@ -352,6 +352,25 @@ func (o *Orchestrator[BLOCK_HASH, HEAD]) GetTransactionFee(ctx context.Context, return nil, errors.New("unimplemented") } +func (o *Orchestrator[BLOCK_HASH, HEAD]) CalculateFee(feeParts txmgr.FeeParts) *big.Int { + totalFee := new(big.Int) + + gasUsed := new(big.Int).SetUint64(feeParts.GasUsed) + price := feeParts.EffectiveGasPrice + if price != nil { + totalFee.Mul(gasUsed, price) + } + l1Fee := feeParts.L1Fee + if l1Fee != nil { + totalFee.Add(totalFee, l1Fee) + } + return totalFee +} + +func (o *Orchestrator[BLOCK_HASH, HEAD]) GetTransactionReceipt(ctx context.Context, transactionID string) (receipt *txmgrtypes.ChainReceipt[BLOCK_HASH, BLOCK_HASH], err error) { + return nil, errors.New("unimplemented") +} + func (o *Orchestrator[BLOCK_HASH, HEAD]) SendNativeToken(ctx context.Context, chainID *big.Int, from, to common.Address, value big.Int, gasLimit uint64) (tx txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) { txRequest := txmgrtypes.TxRequest[common.Address, common.Hash]{ FromAddress: from,