Skip to content

Commit

Permalink
Merge pull request #192 from ewasm/upgrade-evmc
Browse files Browse the repository at this point in the history
Upgrade EVMC
  • Loading branch information
axic authored Apr 24, 2018
2 parents 91d902f + 9a148fa commit a6c07f9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ project(hera)

include(ProjectBinaryen)

option(EVMC_BUILD_EXAMPLES "Build EVMC examples" OFF)
add_subdirectory(evmc)

add_subdirectory(src)
6 changes: 3 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defaults:

save-eth-cache: &save-eth-cache
save_cache:
key: &eth-cache-key cpp-prebuilt-cache-{{arch}}-{{checksum "compiler.version"}}-a17f30a41aa2af506b6b453f052c53bd323a36e0
key: &eth-cache-key cpp-prebuilt-cache-{{arch}}-{{checksum "compiler.version"}}-d658b3ae8195baaa328a213913c47274ce87296d
paths:
- ~/build
- ~/.hunter
Expand All @@ -60,9 +60,9 @@ defaults:
working_directory: ~/project
command: |
cd ..
git clone https://github.com/ethereum/cpp-ethereum --branch develop --single-branch
git clone https://github.com/ethereum/cpp-ethereum --branch upgrade-evmc --single-branch
cd cpp-ethereum
git reset --hard a17f30a41aa2af506b6b453f052c53bd323a36e0
git reset --hard d658b3ae8195baaa328a213913c47274ce87296d
git submodule update --init
link-hera: &link-hera
Expand Down
2 changes: 1 addition & 1 deletion src/eei.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <wasm.h>
#include <wasm-binary.h>
#include <evmc.h>
#include <evmc/evmc.h>
#include "shell-interface.h"
#include "hera.h"
#include "exceptions.h"
Expand Down
10 changes: 5 additions & 5 deletions src/hera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <wasm-printing.h>
#include <wasm-validator.h>

#include <evmc.h>
#include <evmc/evmc.h>

#include "hera.h"
#include "eei.h"
Expand All @@ -54,7 +54,7 @@ struct hera_instance : evmc_instance {
bool use_evm2wasm_js_trace = false;
#endif

hera_instance() : evmc_instance({EVMC_ABI_VERSION, nullptr, nullptr, nullptr}) {}
hera_instance() : evmc_instance({EVMC_ABI_VERSION, "hera", "0.0.0", nullptr, nullptr, nullptr}) {}
};

namespace {
Expand Down Expand Up @@ -344,7 +344,7 @@ evmc_result hera_execute(
} catch (OutOfGasException const&) {
ret.status_code = EVMC_OUT_OF_GAS;
} catch (StaticModeViolation const& e) {
ret.status_code = EVMC_STATIC_MODE_ERROR;
ret.status_code = EVMC_STATIC_MODE_VIOLATION;
#if HERA_DEBUGGING
cerr << e.what() << endl;
#endif
Expand Down Expand Up @@ -404,13 +404,13 @@ void hera_destroy(evmc_instance* instance)

extern "C" {

evmc_instance* hera_create()
evmc_instance* evmc_create_hera()
{
hera_instance* instance = new hera_instance;
instance->destroy = hera_destroy;
instance->execute = hera_execute;
instance->set_option = hera_set_option;
return static_cast<evmc_instance*>(instance);
return instance;
}

}
6 changes: 3 additions & 3 deletions src/hera.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#ifndef __HERA_H
#define __HERA_H

#include <evmc/evmc.h>

#if defined _MSC_VER || defined __MINGW32__
# define HERA_EXPORT __declspec(dllexport)
# define HERA_IMPORT __declspec(dllimport)
Expand All @@ -40,10 +42,8 @@
extern "C" {
#endif

struct evm_instance;

HERA_EXPORT
struct evmc_instance* hera_create(void);
struct evmc_instance* evmc_create_hera(void);

#if __cplusplus
}
Expand Down

0 comments on commit a6c07f9

Please sign in to comment.