EVM-C: Rename message.address -> message.destination

This commit is contained in:
Paweł Bylica 2018-01-23 11:00:55 +01:00
parent 6c65da3577
commit b0de6dcd46
2 changed files with 6 additions and 6 deletions

View File

@ -78,14 +78,14 @@ static struct evm_result execute(struct evm_instance* instance,
if (code_size == strlen(return_address) && if (code_size == strlen(return_address) &&
strncmp((const char*)code, return_address, code_size) == 0) { 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); uint8_t* output_data = (uint8_t*)malloc(address_size);
if (!output_data) { if (!output_data) {
// malloc failed, report internal error. // malloc failed, report internal error.
ret.status_code = EVM_INTERNAL_ERROR; ret.status_code = EVM_INTERNAL_ERROR;
return ret; return ret;
} }
memcpy(output_data, &msg->address, address_size); memcpy(output_data, &msg->destination, address_size);
ret.status_code = EVM_SUCCESS; ret.status_code = EVM_SUCCESS;
ret.output_data = output_data; ret.output_data = output_data;
ret.output_size = address_size; 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) { strncmp((const char*)code, counter, code_size) == 0) {
struct evm_uint256be value; struct evm_uint256be value;
const struct evm_uint256be index = {{0,}}; 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; 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; ret.status_code = EVM_SUCCESS;
return ret; return ret;
} }

View File

@ -69,7 +69,7 @@ enum evm_flags {
/// The message describing an EVM call, /// The message describing an EVM call,
/// including a zero-depth calls from a transaction origin. /// including a zero-depth calls from a transaction origin.
struct evm_message { struct evm_message {
struct evm_address address; ///< The destination of the message. struct evm_address destination; ///< The destination of the message.
struct evm_address sender; ///< The sender of the message. struct evm_address sender; ///< The sender of the message.
/// The amount of Ether transferred with the message. /// The amount of Ether transferred with the message.