Commit Graph

207 Commits

Author SHA1 Message Date
Paweł Bylica d4e61aa84a
test: Add a unit test for MockedAccount 2019-11-28 15:21:00 +01:00
Paweł Bylica d45c0335b2
cmake: Do not link example-host to evmc-unittests 2019-11-27 23:46:46 +01:00
Paweł Bylica 1f982daab2
cmake: Flatten test directory tree
Move compilation and cmake_package tests out of integration dir.
2019-11-27 23:46:45 +01:00
Paweł Bylica c2f77c9da2
cmake: Move vmtester from test/ to tools/ 2019-11-27 23:46:45 +01:00
Paweł Bylica 7f4d145090
vmtester: Use MockedHost instead of ExampleHost 2019-11-27 23:40:37 +01:00
Paweł Bylica 13aabfdd71
vmtester: Small refactoring 2019-11-27 23:40:35 +01:00
Paweł Bylica 236aa76c8d
cpp: Add VM::has_capability() method 2019-11-27 19:02:05 +01:00
Paweł Bylica d8ab2489dd
cpp: Add const to HostInterface 2019-11-27 16:23:30 +01:00
Paweł Bylica b4ae4233f8
test: Use MockedHost instead of example Host 2019-11-21 17:19:37 +01:00
Paweł Bylica 6de0cfe164
Add mocked_host library
It takes the MockedHost implementation from evmone, converts it to C++11 and creates an interface library out of it.
2019-11-21 17:19:37 +01:00
Paweł Bylica 774a21f46c
Fix some clang-tidy warning 2019-11-21 11:23:34 +01:00
Paweł Bylica b76e6d1a02
loader: Handle unexpected error code from set_option() 2019-11-19 21:21:32 +01:00
Paweł Bylica 0522110797
cpp: Require the host interface for HostContext be passed by reference 2019-11-10 10:19:14 +01:00
Paweł Bylica a647969186
test: Add basic unit tests for previously unused API 2019-11-07 16:21:39 +01:00
Paweł Bylica 95737d2721
cpp: Add default constructor for HostContext 2019-11-06 19:42:52 +01:00
Paweł Bylica b8dde4a142
cpp: Add execute() overloading without evmc_context parameter 2019-11-05 16:57:56 +01:00
Paweł Bylica a94829acc1
cmake: Add static variant of Precompiles VM example for unittests 2019-11-05 14:59:43 +01:00
Paweł Bylica 310dc8e438
test: Add C++ API test executing Precompiles VM 2019-11-05 14:59:42 +01:00
Paweł Bylica 7074ce9a63
test: Fix vmtester/precompile_test test 2019-11-05 14:55:44 +01:00
Paweł Bylica e3b84b8b48
Move evmc_host_interface out of evmc_host_context 2019-11-05 11:54:54 +01:00
Paweł Bylica 7b38c1da2d
cmake: Drop evmc- prefix from example VM targets 2019-11-04 17:48:58 +01:00
Paweł Bylica 8234e723f0
loader: Simplify logic for finding create function
The loader library no longer tries EVMC create function names with removed prefixes.
2019-11-04 16:22:55 +01:00
Paweł Bylica 6b0a37029d
loader: Trim all file extensions for create function name 2019-11-04 14:33:00 +01:00
Paweł Bylica 2c3eb42f56
instructions: Change .stack_height_change values 2019-09-28 11:17:36 +02:00
Paweł Bylica 8dd186737a
instructions: Rename .num_stack_returned_items -> .stack_height_change
The values in the table are going to be changed in the following commit.
2019-09-28 11:17:36 +02:00
Paweł Bylica a9cc2483b4
instructions: Rename .num_stack_arguments -> .stack_height_required 2019-09-28 11:17:35 +02:00
Paweł Bylica 28dfad3930
Rename evmc_instance -> evmc_vm 2019-09-25 21:30:32 +02:00
Paweł Bylica cbe260d9cb
test: Rework cpp.result unit test 2019-09-25 13:13:56 +02:00
Paweł Bylica 89e6fb2342
Remove deprecated tracing API 2019-09-25 08:58:03 +02:00
Paweł Bylica 5ba077a384
Rename evmc_context to evmc_host_context 2019-09-20 12:49:58 +02:00
Paweł Bylica 0338ac49cf
cpp: Rename evmc::vm to evmc::VM 2019-09-19 17:40:34 +02:00
Paweł Bylica e87b24dfe1
instructions: Set gas cost for undefined instructions to 0 2019-09-19 16:07:20 +02:00
Paweł Bylica 59663a1171
Officially drop C90 standard support
The support for C90 was accidentally broken in v6 in 280ff99363 - C90 does not have _Bool type.
I don't see it as a problem in practice.
2019-09-13 13:21:54 +02:00
Paweł Bylica 428e9b1463
test: Change EXPECT to ASSERT to protect against invalid memory access 2019-09-13 12:57:29 +02:00
Paweł Bylica 4890dbd3fd
cmake: Disable support for std::tr1::tuple in GTest 2019-09-13 12:51:58 +02:00
Paweł Bylica 4d4e8e6f37
cmake: Upgrade GTest to 1.8.1 2019-09-13 11:59:10 +02:00
Paweł Bylica 0056ef28e6
test: Fix comparison type mismatches
This would cause issue in GTest 1.8.1 on Visual Studio.
2019-09-13 11:57:40 +02:00
Paweł Bylica d0253e5258
cpp: Remove deprecated helpers.hpp 2019-08-21 22:30:55 +02:00
Alex Beregszaszi 0d53dfa8bc instructions: add repricing from EIP-1884 2019-08-21 20:18:06 +02:00
Alex Beregszaszi 3e9e76d5d6 instructions: add SELFBALANCE from EIP-1884 2019-08-21 20:17:48 +02:00
Alex Beregszaszi 14d5def808 Add Berlin HF 2019-08-21 15:37:24 +02:00
Andrei Maiboroda cd93feaf9f
Support for EIP-1344 CHAINID opcode 2019-08-21 11:46:55 +02:00
Alex Beregszaszi dd065265d9 examples: add evmc_tx_context to ExampleHost 2019-08-08 18:11:28 +02:00
Paweł Bylica 17d3471b18
clang-format: Fix includes sorting
The includes sorting config is taken from Aleth with regex for C++ standard library made more restrictive. The functional change is that .h and .hpp files are now equal.
2019-08-06 14:43:19 +02:00
Paweł Bylica dfc9c4d9f1
vmtester: Rework "owning" the loaded VM 2019-08-06 14:21:39 +02:00
Paweł Bylica 9dc9bb081d
vmtester: Accept standard EVMC config options 2019-08-06 14:21:38 +02:00
Paweł Bylica 8c3c6cc9bc
vmtester: Use evmc::vm to properly destroy loaded VM 2019-08-06 14:21:38 +02:00
Paweł Bylica 55329d8dfa
helpers, cpp: Add evmc_make_result() for constructing results
This moves the evmc_result construction logic from evmc::result() constructor to helper.h. This function is now exposed as a C helper, C++ evmc::make_result() helper and used in the evmc::result() constructor.
This is convenient for VM implementations which need to construct C evmc_result, not C++ evmc::result.
2019-08-06 12:27:39 +02:00
Paweł Bylica e4ae2162c5
cpp: Add evmc::result constructor to copy output 2019-08-06 09:52:42 +02:00
Paweł Bylica 4ac70471ec
cpp: Rename literal suffixes: _addr -> _address, _b32 -> _bytes32 2019-07-24 13:17:28 +02:00