Skip to content

Commit a6c07f9

Browse files
authored
Merge pull request #192 from ewasm/upgrade-evmc
Upgrade EVMC
2 parents 91d902f + 9a148fa commit a6c07f9

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ project(hera)
1313

1414
include(ProjectBinaryen)
1515

16-
option(EVMC_BUILD_EXAMPLES "Build EVMC examples" OFF)
1716
add_subdirectory(evmc)
1817

1918
add_subdirectory(src)

circle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defaults:
4545

4646
save-eth-cache: &save-eth-cache
4747
save_cache:
48-
key: &eth-cache-key cpp-prebuilt-cache-{{arch}}-{{checksum "compiler.version"}}-a17f30a41aa2af506b6b453f052c53bd323a36e0
48+
key: &eth-cache-key cpp-prebuilt-cache-{{arch}}-{{checksum "compiler.version"}}-d658b3ae8195baaa328a213913c47274ce87296d
4949
paths:
5050
- ~/build
5151
- ~/.hunter
@@ -60,9 +60,9 @@ defaults:
6060
working_directory: ~/project
6161
command: |
6262
cd ..
63-
git clone https://github.com/ethereum/cpp-ethereum --branch develop --single-branch
63+
git clone https://github.com/ethereum/cpp-ethereum --branch upgrade-evmc --single-branch
6464
cd cpp-ethereum
65-
git reset --hard a17f30a41aa2af506b6b453f052c53bd323a36e0
65+
git reset --hard d658b3ae8195baaa328a213913c47274ce87296d
6666
git submodule update --init
6767
6868
link-hera: &link-hera

evmc

Submodule evmc updated from 93fb868 to c633aa4

src/eei.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include <wasm.h>
2828
#include <wasm-binary.h>
29-
#include <evmc.h>
29+
#include <evmc/evmc.h>
3030
#include "shell-interface.h"
3131
#include "hera.h"
3232
#include "exceptions.h"

src/hera.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <wasm-printing.h>
3838
#include <wasm-validator.h>
3939

40-
#include <evmc.h>
40+
#include <evmc/evmc.h>
4141

4242
#include "hera.h"
4343
#include "eei.h"
@@ -54,7 +54,7 @@ struct hera_instance : evmc_instance {
5454
bool use_evm2wasm_js_trace = false;
5555
#endif
5656

57-
hera_instance() : evmc_instance({EVMC_ABI_VERSION, nullptr, nullptr, nullptr}) {}
57+
hera_instance() : evmc_instance({EVMC_ABI_VERSION, "hera", "0.0.0", nullptr, nullptr, nullptr}) {}
5858
};
5959

6060
namespace {
@@ -344,7 +344,7 @@ evmc_result hera_execute(
344344
} catch (OutOfGasException const&) {
345345
ret.status_code = EVMC_OUT_OF_GAS;
346346
} catch (StaticModeViolation const& e) {
347-
ret.status_code = EVMC_STATIC_MODE_ERROR;
347+
ret.status_code = EVMC_STATIC_MODE_VIOLATION;
348348
#if HERA_DEBUGGING
349349
cerr << e.what() << endl;
350350
#endif
@@ -404,13 +404,13 @@ void hera_destroy(evmc_instance* instance)
404404

405405
extern "C" {
406406

407-
evmc_instance* hera_create()
407+
evmc_instance* evmc_create_hera()
408408
{
409409
hera_instance* instance = new hera_instance;
410410
instance->destroy = hera_destroy;
411411
instance->execute = hera_execute;
412412
instance->set_option = hera_set_option;
413-
return static_cast<evmc_instance*>(instance);
413+
return instance;
414414
}
415415

416416
}

src/hera.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#ifndef __HERA_H
2626
#define __HERA_H
2727

28+
#include <evmc/evmc.h>
29+
2830
#if defined _MSC_VER || defined __MINGW32__
2931
# define HERA_EXPORT __declspec(dllexport)
3032
# define HERA_IMPORT __declspec(dllimport)
@@ -40,10 +42,8 @@
4042
extern "C" {
4143
#endif
4244

43-
struct evm_instance;
44-
4545
HERA_EXPORT
46-
struct evmc_instance* hera_create(void);
46+
struct evmc_instance* evmc_create_hera(void);
4747

4848
#if __cplusplus
4949
}

0 commit comments

Comments
 (0)