From d529efcf00f7d3f0fec6460c41552dabf27be25a Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 21 Aug 2016 19:07:35 +0100 Subject: [PATCH 1/4] EVM-C: include struct keyword where types are not typedef'd --- include/evm.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/evm.h b/include/evm.h index c8d1303..55fc226 100644 --- a/include/evm.h +++ b/include/evm.h @@ -319,12 +319,15 @@ EXPORT void evm_destroy_result(struct evm_result); /// @{ -EXPORT bool evmjit_is_code_ready(evm_instance* instance, evm_mode mode, - evm_hash256 code_hash); +EXPORT bool evmjit_is_code_ready(struct evm_instance* instance, + enum evm_mode mode, + struct evm_hash256 code_hash); -EXPORT void evmjit_compile(evm_instance* instance, evm_mode mode, - uint8_t const* code, size_t code_size, - evm_hash256 code_hash); +EXPORT void evmjit_compile(struct evm_instance* instance, + enum evm_mode mode, + uint8_t const* code, + size_t code_size, + struct evm_hash256 code_hash); /// @} From ce75278de753439c2ca363fd67316d774bf2db24 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 21 Aug 2016 19:08:42 +0100 Subject: [PATCH 2/4] EMV-C: include description for evm_update_fn --- include/evm.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/evm.h b/include/evm.h index 55fc226..7737a1b 100644 --- a/include/evm.h +++ b/include/evm.h @@ -174,7 +174,24 @@ enum evm_update_key { }; -/// Callback function for modifying a contract state. +/// Update callback function. +/// +/// This callback function is used by the EVM to modify contract state in the +/// host application. +/// @param env Pointer to execution environment managed by the host +/// application. +/// @param key The kind of the update. See evm_update_key and details below. +/// @param arg1 Additional argument to the update. It has defined value only for +/// the subset of update keys. +/// @param arg1 Additional argument to the update. It has defined value only for +/// the subset of update keys. +/// +/// ## Types of updates +/// Key | Arg1 | Arg2 +/// ----------------------| -------------------- | -------------------- +/// ::EVM_SSTORE | evm_variant::uint256 | evm_variant::uint256 +/// ::EVM_LOG | evm_variant::data | evm_variant::data +/// ::EVM_SELFDESTRUCT | evm_variant::address | typedef void (*evm_update_fn)(struct evm_env* env, enum evm_update_key key, union evm_variant arg1, From d14fd8563f51028346cbad2b3c873b63e5254c9b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 21 Aug 2016 19:09:12 +0100 Subject: [PATCH 3/4] EVM-C: update description of evm_query_fn to match current implementation --- include/evm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/evm.h b/include/evm.h index 7737a1b..2040b7e 100644 --- a/include/evm.h +++ b/include/evm.h @@ -154,12 +154,12 @@ union evm_variant { /// ::EVM_ORIGIN | | evm_variant::address /// ::EVM_COINBASE | | evm_variant::address /// ::EVM_DIFFICULTY | | evm_variant::uint256 -/// ::EVM_GAS_LIMIT | | evm_variant::int64 +/// ::EVM_GAS_LIMIT | | evm_variant::uint256 /// ::EVM_NUMBER | | evm_variant::int64? /// ::EVM_TIMESTAMP | | evm_variant::int64? /// ::EVM_CODE_BY_ADDRESS | evm_variant::address | evm_variant::bytes /// ::EVM_BALANCE | evm_variant::address | evm_variant::uint256 -/// ::EVM_BLOCKHASH | evm_variant::int64 | evm_variant::uint256 +/// ::EVM_BLOCKHASH | evm_variant::int64 | evm_variant::hash256 /// ::EVM_SLOAD | evm_variant::uint256 | evm_variant::uint256? typedef union evm_variant (*evm_query_fn)(struct evm_env* env, enum evm_query_key key, From 5c5c7087af8f2b5d00ca5077803beea59dd8ddda Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 22 Aug 2016 11:44:50 +0100 Subject: [PATCH 4/4] EVM-C: use evm_variant::data for EVM_CODE_BY_ADDRESS so that Doxygen picks it up correctly --- include/evm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/evm.h b/include/evm.h index 2040b7e..98e4cb8 100644 --- a/include/evm.h +++ b/include/evm.h @@ -157,7 +157,7 @@ union evm_variant { /// ::EVM_GAS_LIMIT | | evm_variant::uint256 /// ::EVM_NUMBER | | evm_variant::int64? /// ::EVM_TIMESTAMP | | evm_variant::int64? -/// ::EVM_CODE_BY_ADDRESS | evm_variant::address | evm_variant::bytes +/// ::EVM_CODE_BY_ADDRESS | evm_variant::address | evm_variant::data /// ::EVM_BALANCE | evm_variant::address | evm_variant::uint256 /// ::EVM_BLOCKHASH | evm_variant::int64 | evm_variant::hash256 /// ::EVM_SLOAD | evm_variant::uint256 | evm_variant::uint256?