Commit Graph

8 Commits

Author SHA1 Message Date
yihuang
1fe07edbf9
evm: refactor dup state transition code (#674)
* Problem: state transition code is duplicated

Closes: #672

Solution:
- move gas refund out from ApplyMessage
- move check into ApplyMessage
- move evm construction into ApplyMessage
- ensure context stack is clean after ApplyMessage return

fix unit tests

undo rename

add underflow check

* improve performance

- don't duplicate params loading
- passing EVMConfig around as pointer
2021-10-22 19:21:03 +02:00
JayT106
40b3b9ae1b
evm: unit tests for gas refund (#686)
* add TestGetEthIntrinsicGas

* more test cases in TestGetEthIntrinsicGas

* add GasToRefund tests

* add TestRefundGas tests

* remove duplicate leftoverGas check

* made resetGasMeterAndConsumeGas public for testing

* TestResetGasMeterAndConsumeGas tmp

* add mintFeeCollector flag for gas refund tests

* add comment and check

* add TestResetGasMeterAndConsumeGas

* Update x/evm/keeper/state_transition_test.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-10-20 19:09:06 +00:00
JayT106
2476cc5e3c
remove unused var (#680)
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-10-16 14:41:44 +00:00
Federico Kunze Küllmer
26c5eabb18
all: linter (#532)
* add additional linters

* fixes

* rm action
2021-09-05 11:03:06 +00:00
Federico Kunze Küllmer
516ffe2bf1
evm: GetHashFn test (#515) 2021-08-31 15:58:46 +00:00
Federico Kunze Küllmer
87c4ea2dc2
evm: benchmark state DB (#514)
* evm: benchmark state DB

* add more bech funcs

* rm func from interface
2021-08-31 12:50:31 +00:00
yihuang
f6dc80d949
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>
2021-07-23 14:24:36 +00:00
Federico Kunze Küllmer
9d1ce30ecd
evm: use block proposer address for COINBASE opcode (#291)
* evm: use block proposer address for COINBASE opcode

* test

* c++
2021-07-14 20:44:51 +00:00