From b0de6dcd46ca226c50f8614ea01cf8d8e70ec2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 23 Jan 2018 11:00:55 +0100 Subject: [PATCH 1/2] EVM-C: Rename message.address -> message.destination --- examples/examplevm.c | 8 ++++---- include/evm.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/examplevm.c b/examples/examplevm.c index 17db5d9..8cc77cb 100644 --- a/examples/examplevm.c +++ b/examples/examplevm.c @@ -78,14 +78,14 @@ static struct evm_result execute(struct evm_instance* instance, if (code_size == strlen(return_address) && strncmp((const char*)code, return_address, code_size) == 0) { - static const size_t address_size = sizeof(msg->address); + static const size_t address_size = sizeof(msg->destination); uint8_t* output_data = (uint8_t*)malloc(address_size); if (!output_data) { // malloc failed, report internal error. ret.status_code = EVM_INTERNAL_ERROR; return ret; } - memcpy(output_data, &msg->address, address_size); + memcpy(output_data, &msg->destination, address_size); ret.status_code = EVM_SUCCESS; ret.output_data = output_data; ret.output_size = address_size; @@ -96,9 +96,9 @@ static struct evm_result execute(struct evm_instance* instance, strncmp((const char*)code, counter, code_size) == 0) { struct evm_uint256be value; const struct evm_uint256be index = {{0,}}; - context->fn_table->get_storage(&value, context, &msg->address, &index); + context->fn_table->get_storage(&value, context, &msg->destination, &index); value.bytes[31] += 1; - context->fn_table->set_storage(context, &msg->address, &index, &value); + context->fn_table->set_storage(context, &msg->destination, &index, &value); ret.status_code = EVM_SUCCESS; return ret; } diff --git a/include/evm.h b/include/evm.h index 9bf8e01..0020331 100644 --- a/include/evm.h +++ b/include/evm.h @@ -69,8 +69,8 @@ enum evm_flags { /// The message describing an EVM call, /// including a zero-depth calls from a transaction origin. struct evm_message { - struct evm_address address; ///< The destination of the message. - struct evm_address sender; ///< The sender of the message. + struct evm_address destination; ///< The destination of the message. + struct evm_address sender; ///< The sender of the message. /// The amount of Ether transferred with the message. struct evm_uint256be value; From e33bdbcabefb0c4f021a7f3bdee73a9139803178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 23 Jan 2018 14:21:56 +0100 Subject: [PATCH 2/2] EVM-C: Rename message.input -> message.input_data --- include/evm.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/evm.h b/include/evm.h index 0020331..770830d 100644 --- a/include/evm.h +++ b/include/evm.h @@ -78,10 +78,11 @@ struct evm_message { /// The message input data. /// /// This MAY be NULL. - const uint8_t* input; + const uint8_t* input_data; + /// The size of the message input data. /// - /// If input is NULL this MUST be 0. + /// If input_data is NULL this MUST be 0. size_t input_size; /// The optional hash of the code of the destination account. @@ -94,8 +95,8 @@ struct evm_message { /// The kind of the call. For zero-depth calls ::EVM_CALL SHOULD be used. enum evm_call_kind kind; - ///< Additional flags modifying the call execution behavior. - ///< In the current version the only valid values are ::EVM_STATIC or 0. + /// Additional flags modifying the call execution behavior. + /// In the current version the only valid values are ::EVM_STATIC or 0. uint32_t flags; }; @@ -198,9 +199,7 @@ struct evm_result { /// freed with evm_result::release(). /// /// This MAY be NULL. - /// - /// @todo Inconsistent name: output_data vs msg.input. - uint8_t const* output_data; + const uint8_t* output_data; /// The size of the output data. ///