From a5ab608336276e99ba18556ffbdaee9ccdc9ca93 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 30 Aug 2021 11:14:58 +0800 Subject: [PATCH] evm: benchmark contract execution (#436) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- .../test/mocks/StandardTokenMock.sol | 8 ++ x/evm/keeper/ERC20Contract.json | 4 +- x/evm/keeper/benchevm_test.go | 79 ++++++++++++++ x/evm/keeper/grpc_query_test.go | 76 +------------ x/evm/keeper/keeper_test.go | 101 ++++++++++++++++-- 5 files changed, 184 insertions(+), 84 deletions(-) create mode 100644 x/evm/keeper/benchevm_test.go diff --git a/tests/solidity/suites/staking/contracts/test/mocks/StandardTokenMock.sol b/tests/solidity/suites/staking/contracts/test/mocks/StandardTokenMock.sol index e79a2477..80016900 100644 --- a/tests/solidity/suites/staking/contracts/test/mocks/StandardTokenMock.sol +++ b/tests/solidity/suites/staking/contracts/test/mocks/StandardTokenMock.sol @@ -212,4 +212,12 @@ contract StandardTokenMock is ERC20 { allowed[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount); _burn(_account, _amount); } + + // For benchmarks + event TestLog(address sender, uint i); + function benchmarkLogs(uint n) public { + for (uint i=0; i