evm: estimate gas unit tests (#324)

* add some unit tests for estimateGas

Also add some test environment setup, Closes #323

test estimateGas of erc20 token transfer

fix failed test case

the trick is to keep a clean transient store, by doing a commit

put artifacts to external file

* fix test failure

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
yihuang
2021-07-23 14:24:36 +00:00
committed by GitHub
co-authored by Federico Kunze Küllmer
parent e61594e10a
commit f6dc80d949
8 changed files with 255 additions and 22 deletions
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
# prepare sloc v0.5.17 in PATH
solc --combined-json bin,abi --allow-paths . ./tests/solidity/suites/staking/contracts/test/mocks/StandardTokenMock.sol \
| jq ".contracts.\"./tests/solidity/suites/staking/contracts/test/mocks/StandardTokenMock.sol:StandardTokenMock\"" \
> x/evm/keeper/ERC20Contract.json