Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

[Tests] Refactor evm_test.go into table tests #1277

Open
3 tasks
silasdavis opened this issue Sep 30, 2019 · 0 comments
Open
3 tasks

[Tests] Refactor evm_test.go into table tests #1277

silasdavis opened this issue Sep 30, 2019 · 0 comments

Comments

@silasdavis
Copy link
Contributor

silasdavis commented Sep 30, 2019

evm_test.go seems like a good candidate to be rewritten as a single table-based test where we:

  • Set up some initial state, i.e. accounts/storage
  • Run some bytecode
  • Check return value equals expected

There is a small amount of code that does something a little more exotic (like checking for infinite loops) but I suspect it could be folded in.

Ideally we would refactor to achieve the following:

  • Single test harness running one test per row of initial state, code, expected results in a table structure
  • Use the opcode constant symbols (older tests use literal byte values) and MustSplice to make code more readable
  • Make the test harness pluggable so that we can run identical tests against different Callables

The idea of the last point is that we could test both the executor and the EVM with the same bytecode when testing our transaction execution machinery. Currently there is some VM functionality only tested in execution_test.go (which needs refactoring). If we can wrap the EVM as callable and the executor as a callable we should be able to run a complete battery of EVM tests under different execution scenarios rather the recreating an incomplete subset of VM tests at each level.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants