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 b1d8b07..4e2a1f3 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; @@ -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; }; @@ -200,9 +201,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. ///