EVM-C: Rename evm_result_error_code -> evm_result_code

This commit is contained in:
Paweł Bylica 2016-08-25 13:44:34 +02:00
parent 85ee6de4be
commit 2e6b278a59
3 changed files with 10 additions and 11 deletions

View File

@ -80,8 +80,8 @@ int main(int argc, char *argv[]) {
sizeof(input), value);
printf("Execution result:\n");
if (result.error_code != EVM_SUCCESS) {
printf(" EVM execution failure: %d\n", result.error_code);
if (result.code != EVM_SUCCESS) {
printf(" EVM execution failure: %d\n", result.code);
} else {
printf(" Gas used: %ld\n", gas - result.gas_left);
printf(" Gas left: %ld\n", result.gas_left);

View File

@ -67,7 +67,7 @@ static struct evm_result evm_execute(struct evm_instance* instance,
// Execute code and refer to callbacks: instance->query_fn()
ret.error_code = EVM_FAILURE;
ret.code = EVM_FAILURE;
ret.gas_left = 0;
return ret;

View File

@ -59,8 +59,8 @@ struct evm_hash256 {
};
};
/// The result error code.
enum evm_result_error_code {
/// The execution result code.
enum evm_result_code {
EVM_SUCCESS = 0, ///< Execution finished with success.
EVM_FAILURE = 1, ///< Generic execution failure.
EVM_OUT_OF_GAS = 2,
@ -72,16 +72,15 @@ enum evm_result_error_code {
/// The EVM code execution result.
struct evm_result {
/// The result error code.
enum evm_result_error_code error_code;
/// The execution result code.
enum evm_result_code code;
/// The amount of gas left after the execution.
///
/// The value is valid only if
/// evm_result_error_code::error_code == evm_result_error_code::EVM_SUCCESS.
/// The value is valid only if evm_result::code == ::EVM_SUCCESS.
int64_t gas_left;
/// The rerefence to output data. The memory containing the output data
/// The reference to output data. The memory containing the output data
/// is owned by EVM and is freed with evm_release_result_fn().
uint8_t const* output_data;
@ -96,7 +95,7 @@ struct evm_result {
/// @see output_data.
void* internal_memory;
/// The error message explaining the error_code.
/// The error message explaining the result code.
char const* error_message;
/// @}