From 710c60c5eeaf0043a88555038fecfee0621eb397 Mon Sep 17 00:00:00 2001 From: Anirudh Warrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:01:28 +0400 Subject: [PATCH] update smoke test to use UpkeepCounter [AUTO-9246] (#12371) * update smoke test to use UpkeepCounter * fix references in chaincli --- .changeset/fresh-spies-melt.md | 5 +++ .../automation/testhelpers/UpkeepCounter.sol | 28 ++++++------ .../upkeep_counter_wrapper.go | 44 +++++++++---------- ...rapper-dependency-versions-do-not-edit.txt | 2 +- .../chaincli/handler/keeper_upkeep_events.go | 8 ++-- integration-tests/actions/keeper_helpers.go | 2 +- .../contracts/ethereum_keeper_contracts.go | 6 +++ 7 files changed, 53 insertions(+), 42 deletions(-) create mode 100644 .changeset/fresh-spies-melt.md diff --git a/.changeset/fresh-spies-melt.md b/.changeset/fresh-spies-melt.md new file mode 100644 index 00000000000..ad341d1db91 --- /dev/null +++ b/.changeset/fresh-spies-melt.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Update automation smoke test to use UpkeepCounter with time based counter diff --git a/contracts/src/v0.8/automation/testhelpers/UpkeepCounter.sol b/contracts/src/v0.8/automation/testhelpers/UpkeepCounter.sol index caeed98e302..24a8b1f9010 100644 --- a/contracts/src/v0.8/automation/testhelpers/UpkeepCounter.sol +++ b/contracts/src/v0.8/automation/testhelpers/UpkeepCounter.sol @@ -4,25 +4,25 @@ pragma solidity 0.8.16; contract UpkeepCounter { event PerformingUpkeep( address indexed from, - uint256 initialBlock, - uint256 lastBlock, + uint256 initialTimestamp, + uint256 lastTimestamp, uint256 previousBlock, uint256 counter ); uint256 public testRange; uint256 public interval; - uint256 public lastBlock; + uint256 public lastTimestamp; uint256 public previousPerformBlock; - uint256 public initialBlock; + uint256 public initialTimestamp; uint256 public counter; constructor(uint256 _testRange, uint256 _interval) { testRange = _testRange; interval = _interval; previousPerformBlock = 0; - lastBlock = block.number; - initialBlock = 0; + lastTimestamp = block.timestamp; + initialTimestamp = 0; counter = 0; } @@ -31,28 +31,28 @@ contract UpkeepCounter { } function performUpkeep(bytes calldata performData) external { - if (initialBlock == 0) { - initialBlock = block.number; + if (initialTimestamp == 0) { + initialTimestamp = block.timestamp; } - lastBlock = block.number; + lastTimestamp = block.timestamp; counter = counter + 1; performData; - emit PerformingUpkeep(tx.origin, initialBlock, lastBlock, previousPerformBlock, counter); - previousPerformBlock = lastBlock; + emit PerformingUpkeep(tx.origin, initialTimestamp, lastTimestamp, previousPerformBlock, counter); + previousPerformBlock = lastTimestamp; } function eligible() public view returns (bool) { - if (initialBlock == 0) { + if (initialTimestamp == 0) { return true; } - return (block.number - initialBlock) < testRange && (block.number - lastBlock) >= interval; + return (block.timestamp - initialTimestamp) < testRange && (block.timestamp - lastTimestamp) >= interval; } function setSpread(uint256 _testRange, uint256 _interval) external { testRange = _testRange; interval = _interval; - initialBlock = 0; + initialTimestamp = 0; counter = 0; } } diff --git a/core/gethwrappers/generated/upkeep_counter_wrapper/upkeep_counter_wrapper.go b/core/gethwrappers/generated/upkeep_counter_wrapper/upkeep_counter_wrapper.go index 13db591730e..5363e4e57de 100644 --- a/core/gethwrappers/generated/upkeep_counter_wrapper/upkeep_counter_wrapper.go +++ b/core/gethwrappers/generated/upkeep_counter_wrapper/upkeep_counter_wrapper.go @@ -31,8 +31,8 @@ var ( ) var UpkeepCounterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_testRange\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_interval\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"initialBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"counter\",\"type\":\"uint256\"}],\"name\":\"PerformingUpkeep\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"checkUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"counter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eligible\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"interval\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"}],\"name\":\"performUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"previousPerformBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_testRange\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_interval\",\"type\":\"uint256\"}],\"name\":\"setSpread\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"testRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5060405161048338038061048383398101604081905261002f9161004d565b60009182556001556003819055436002556004819055600555610071565b6000806040838503121561006057600080fd5b505080516020909101519092909150565b610403806100806000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80637f407edf11610076578063917d895f1161005b578063917d895f14610150578063947a36fb14610159578063d832d92f1461016257600080fd5b80637f407edf14610127578063806b984f1461014757600080fd5b806361bc221a116100a757806361bc221a146100f45780636250a13a146100fd5780636e04ff0d1461010657600080fd5b80632cb15864146100c35780634585e33b146100df575b600080fd5b6100cc60045481565b6040519081526020015b60405180910390f35b6100f26100ed366004610291565b61017a565b005b6100cc60055481565b6100cc60005481565b610119610114366004610291565b6101fd565b6040516100d6929190610303565b6100f2610135366004610379565b60009182556001556004819055600555565b6100cc60025481565b6100cc60035481565b6100cc60015481565b61016a61024f565b60405190151581526020016100d6565b60045460000361018957436004555b4360025560055461019b9060016103ca565b600581905560045460025460035460408051938452602084019290925290820152606081019190915232907f8e8112f20a2134e18e591d2cdd68cd86a95d06e6328ede501fc6314f4a5075fa9060800160405180910390a25050600254600355565b6000606061020961024f565b848481818080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250959a92995091975050505050505050565b60006004546000036102615750600190565b60005460045461027190436103e3565b10801561028c575060015460025461028990436103e3565b10155b905090565b600080602083850312156102a457600080fd5b823567ffffffffffffffff808211156102bc57600080fd5b818501915085601f8301126102d057600080fd5b8135818111156102df57600080fd5b8660208285010111156102f157600080fd5b60209290920196919550909350505050565b821515815260006020604081840152835180604085015260005b818110156103395785810183015185820160600152820161031d565b5060006060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116850101925050509392505050565b6000806040838503121561038c57600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156103dd576103dd61039b565b92915050565b818103818111156103dd576103dd61039b56fea164736f6c6343000810000a", + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_testRange\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_interval\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"initialTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"counter\",\"type\":\"uint256\"}],\"name\":\"PerformingUpkeep\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"checkUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"counter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eligible\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"interval\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"}],\"name\":\"performUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"previousPerformBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_testRange\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_interval\",\"type\":\"uint256\"}],\"name\":\"setSpread\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"testRange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5060405161048338038061048383398101604081905261002f9161004d565b60009182556001556003819055426002556004819055600555610071565b6000806040838503121561006057600080fd5b505080516020909101519092909150565b610403806100806000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80637f407edf11610076578063947a36fb1161005b578063947a36fb14610150578063d6d1417114610159578063d832d92f1461016257600080fd5b80637f407edf14610127578063917d895f1461014757600080fd5b806361bc221a116100a757806361bc221a146100f45780636250a13a146100fd5780636e04ff0d1461010657600080fd5b806319d8ac61146100c35780634585e33b146100df575b600080fd5b6100cc60025481565b6040519081526020015b60405180910390f35b6100f26100ed366004610291565b61017a565b005b6100cc60055481565b6100cc60005481565b610119610114366004610291565b6101fd565b6040516100d6929190610303565b6100f2610135366004610379565b60009182556001556004819055600555565b6100cc60035481565b6100cc60015481565b6100cc60045481565b61016a61024f565b60405190151581526020016100d6565b60045460000361018957426004555b4260025560055461019b9060016103ca565b600581905560045460025460035460408051938452602084019290925290820152606081019190915232907f8e8112f20a2134e18e591d2cdd68cd86a95d06e6328ede501fc6314f4a5075fa9060800160405180910390a25050600254600355565b6000606061020961024f565b848481818080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250959a92995091975050505050505050565b60006004546000036102615750600190565b60005460045461027190426103e3565b10801561028c575060015460025461028990426103e3565b10155b905090565b600080602083850312156102a457600080fd5b823567ffffffffffffffff808211156102bc57600080fd5b818501915085601f8301126102d057600080fd5b8135818111156102df57600080fd5b8660208285010111156102f157600080fd5b60209290920196919550909350505050565b821515815260006020604081840152835180604085015260005b818110156103395785810183015185820160600152820161031d565b5060006060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116850101925050509392505050565b6000806040838503121561038c57600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156103dd576103dd61039b565b92915050565b818103818111156103dd576103dd61039b56fea164736f6c6343000810000a", } var UpkeepCounterABI = UpkeepCounterMetaData.ABI @@ -238,9 +238,9 @@ func (_UpkeepCounter *UpkeepCounterCallerSession) Eligible() (bool, error) { return _UpkeepCounter.Contract.Eligible(&_UpkeepCounter.CallOpts) } -func (_UpkeepCounter *UpkeepCounterCaller) InitialBlock(opts *bind.CallOpts) (*big.Int, error) { +func (_UpkeepCounter *UpkeepCounterCaller) InitialTimestamp(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _UpkeepCounter.contract.Call(opts, &out, "initialBlock") + err := _UpkeepCounter.contract.Call(opts, &out, "initialTimestamp") if err != nil { return *new(*big.Int), err @@ -252,12 +252,12 @@ func (_UpkeepCounter *UpkeepCounterCaller) InitialBlock(opts *bind.CallOpts) (*b } -func (_UpkeepCounter *UpkeepCounterSession) InitialBlock() (*big.Int, error) { - return _UpkeepCounter.Contract.InitialBlock(&_UpkeepCounter.CallOpts) +func (_UpkeepCounter *UpkeepCounterSession) InitialTimestamp() (*big.Int, error) { + return _UpkeepCounter.Contract.InitialTimestamp(&_UpkeepCounter.CallOpts) } -func (_UpkeepCounter *UpkeepCounterCallerSession) InitialBlock() (*big.Int, error) { - return _UpkeepCounter.Contract.InitialBlock(&_UpkeepCounter.CallOpts) +func (_UpkeepCounter *UpkeepCounterCallerSession) InitialTimestamp() (*big.Int, error) { + return _UpkeepCounter.Contract.InitialTimestamp(&_UpkeepCounter.CallOpts) } func (_UpkeepCounter *UpkeepCounterCaller) Interval(opts *bind.CallOpts) (*big.Int, error) { @@ -282,9 +282,9 @@ func (_UpkeepCounter *UpkeepCounterCallerSession) Interval() (*big.Int, error) { return _UpkeepCounter.Contract.Interval(&_UpkeepCounter.CallOpts) } -func (_UpkeepCounter *UpkeepCounterCaller) LastBlock(opts *bind.CallOpts) (*big.Int, error) { +func (_UpkeepCounter *UpkeepCounterCaller) LastTimestamp(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _UpkeepCounter.contract.Call(opts, &out, "lastBlock") + err := _UpkeepCounter.contract.Call(opts, &out, "lastTimestamp") if err != nil { return *new(*big.Int), err @@ -296,12 +296,12 @@ func (_UpkeepCounter *UpkeepCounterCaller) LastBlock(opts *bind.CallOpts) (*big. } -func (_UpkeepCounter *UpkeepCounterSession) LastBlock() (*big.Int, error) { - return _UpkeepCounter.Contract.LastBlock(&_UpkeepCounter.CallOpts) +func (_UpkeepCounter *UpkeepCounterSession) LastTimestamp() (*big.Int, error) { + return _UpkeepCounter.Contract.LastTimestamp(&_UpkeepCounter.CallOpts) } -func (_UpkeepCounter *UpkeepCounterCallerSession) LastBlock() (*big.Int, error) { - return _UpkeepCounter.Contract.LastBlock(&_UpkeepCounter.CallOpts) +func (_UpkeepCounter *UpkeepCounterCallerSession) LastTimestamp() (*big.Int, error) { + return _UpkeepCounter.Contract.LastTimestamp(&_UpkeepCounter.CallOpts) } func (_UpkeepCounter *UpkeepCounterCaller) PreviousPerformBlock(opts *bind.CallOpts) (*big.Int, error) { @@ -433,12 +433,12 @@ func (it *UpkeepCounterPerformingUpkeepIterator) Close() error { } type UpkeepCounterPerformingUpkeep struct { - From common.Address - InitialBlock *big.Int - LastBlock *big.Int - PreviousBlock *big.Int - Counter *big.Int - Raw types.Log + From common.Address + InitialTimestamp *big.Int + LastTimestamp *big.Int + PreviousBlock *big.Int + Counter *big.Int + Raw types.Log } func (_UpkeepCounter *UpkeepCounterFilterer) FilterPerformingUpkeep(opts *bind.FilterOpts, from []common.Address) (*UpkeepCounterPerformingUpkeepIterator, error) { @@ -528,11 +528,11 @@ type UpkeepCounterInterface interface { Eligible(opts *bind.CallOpts) (bool, error) - InitialBlock(opts *bind.CallOpts) (*big.Int, error) + InitialTimestamp(opts *bind.CallOpts) (*big.Int, error) Interval(opts *bind.CallOpts) (*big.Int, error) - LastBlock(opts *bind.CallOpts) (*big.Int, error) + LastTimestamp(opts *bind.CallOpts) (*big.Int, error) PreviousPerformBlock(opts *bind.CallOpts) (*big.Int, error) diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 18b0ba1c431..446b481d1d7 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -81,7 +81,7 @@ streams_lookup_upkeep_wrapper: ../../contracts/solc/v0.8.16/StreamsLookupUpkeep/ test_api_consumer_wrapper: ../../contracts/solc/v0.6/TestAPIConsumer/TestAPIConsumer.abi ../../contracts/solc/v0.6/TestAPIConsumer/TestAPIConsumer.bin ed10893cb18894c18e275302329c955f14ea2de37ee044f84aa1e067ac5ea71e trusted_blockhash_store: ../../contracts/solc/v0.8.6/TrustedBlockhashStore/TrustedBlockhashStore.abi ../../contracts/solc/v0.8.6/TrustedBlockhashStore/TrustedBlockhashStore.bin 98cb0dc06c15af5dcd3b53bdfc98e7ed2489edc96a42203294ac2fc0efdda02b type_and_version_interface_wrapper: ../../contracts/solc/v0.8.6/KeeperRegistry1_2/TypeAndVersionInterface.abi ../../contracts/solc/v0.8.6/KeeperRegistry1_2/TypeAndVersionInterface.bin bc9c3a6e73e3ebd5b58754df0deeb3b33f4bb404d5709bb904aed51d32f4b45e -upkeep_counter_wrapper: ../../contracts/solc/v0.8.16/UpkeepCounter/UpkeepCounter.abi ../../contracts/solc/v0.8.16/UpkeepCounter/UpkeepCounter.bin 77f000229a501f638dd2dc439859257f632894c728b31e68aea4f6d6c52f1b71 +upkeep_counter_wrapper: ../../contracts/solc/v0.8.16/UpkeepCounter/UpkeepCounter.abi ../../contracts/solc/v0.8.16/UpkeepCounter/UpkeepCounter.bin cef953186d12ac802e54d17c897d01605b60bbe0ce2df3b4cf2c31c5c3168b35 upkeep_perform_counter_restrictive_wrapper: ../../contracts/solc/v0.8.16/UpkeepPerformCounterRestrictive/UpkeepPerformCounterRestrictive.abi ../../contracts/solc/v0.8.16/UpkeepPerformCounterRestrictive/UpkeepPerformCounterRestrictive.bin 20955b21acceb58355fa287b29194a73edf5937067ba7140667301017cb2b24c upkeep_transcoder: ../../contracts/solc/v0.8.6/UpkeepTranscoder/UpkeepTranscoder.abi ../../contracts/solc/v0.8.6/UpkeepTranscoder/UpkeepTranscoder.bin 336c92a981597be26508455f81a908a0784a817b129a59686c5b2c4afcba730a verifiable_load_log_trigger_upkeep_wrapper: ../../contracts/solc/v0.8.16/VerifiableLoadLogTriggerUpkeep/VerifiableLoadLogTriggerUpkeep.abi ../../contracts/solc/v0.8.16/VerifiableLoadLogTriggerUpkeep/VerifiableLoadLogTriggerUpkeep.bin ee5c608e4e84c80934e42b0c02a49624840adf10b50c91f688bf8f0c7c6994c2 diff --git a/core/scripts/chaincli/handler/keeper_upkeep_events.go b/core/scripts/chaincli/handler/keeper_upkeep_events.go index d63badb6f61..9625eaea67a 100644 --- a/core/scripts/chaincli/handler/keeper_upkeep_events.go +++ b/core/scripts/chaincli/handler/keeper_upkeep_events.go @@ -48,14 +48,14 @@ func (k *Keeper) UpkeepCounterEvents(ctx context.Context, hexAddr string, fromBl for upkeepIterator.Next() { fmt.Printf("%s,%s,%s,%s,%s\n", upkeepIterator.Event.From, - upkeepIterator.Event.InitialBlock, - upkeepIterator.Event.LastBlock, + upkeepIterator.Event.InitialTimestamp, + upkeepIterator.Event.LastTimestamp, upkeepIterator.Event.PreviousBlock, upkeepIterator.Event.Counter, ) row = []string{upkeepIterator.Event.From.String(), - upkeepIterator.Event.InitialBlock.String(), - upkeepIterator.Event.LastBlock.String(), + upkeepIterator.Event.InitialTimestamp.String(), + upkeepIterator.Event.LastTimestamp.String(), upkeepIterator.Event.PreviousBlock.String(), upkeepIterator.Event.Counter.String()} if err = w.Write(row); err != nil { diff --git a/integration-tests/actions/keeper_helpers.go b/integration-tests/actions/keeper_helpers.go index edd0dc5f735..950d14ac8ea 100644 --- a/integration-tests/actions/keeper_helpers.go +++ b/integration-tests/actions/keeper_helpers.go @@ -418,7 +418,7 @@ func DeployKeeperConsumers(t *testing.T, contractDeployer contracts.ContractDepl keeperConsumerInstance, err = contractDeployer.DeployAutomationLogTriggerConsumer(big.NewInt(1000)) // 1000 block test range } else { // v2.0 and v2.1: Conditional based contract without Mercury - keeperConsumerInstance, err = contractDeployer.DeployKeeperConsumer(big.NewInt(5)) + keeperConsumerInstance, err = contractDeployer.DeployUpkeepCounter(big.NewInt(999999), big.NewInt(5)) } require.NoError(t, err, "Deploying Consumer instance %d shouldn't fail", contractCount+1) diff --git a/integration-tests/contracts/ethereum_keeper_contracts.go b/integration-tests/contracts/ethereum_keeper_contracts.go index 3622edcef5f..ac8e12a47ec 100644 --- a/integration-tests/contracts/ethereum_keeper_contracts.go +++ b/integration-tests/contracts/ethereum_keeper_contracts.go @@ -106,6 +106,7 @@ type UpkeepCounter interface { Fund(ethAmount *big.Float) error Counter(ctx context.Context) (*big.Int, error) SetSpread(testRange *big.Int, interval *big.Int) error + Start() error } type UpkeepPerformCounterRestrictive interface { @@ -1834,6 +1835,11 @@ func (v *EthereumUpkeepCounter) SetSpread(testRange *big.Int, interval *big.Int) return v.client.ProcessTransaction(tx) } +// Just pass for non-logtrigger +func (v *EthereumUpkeepCounter) Start() error { + return nil +} + // EthereumUpkeepPerformCounterRestrictive represents keeper consumer (upkeep) counter contract type EthereumUpkeepPerformCounterRestrictive struct { client blockchain.EVMClient