mirror of https://github.com/status-im/evmc.git
EVM-C: Rename evm_result_error_code -> evm_result_code
This commit is contained in:
parent
85ee6de4be
commit
2e6b278a59
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
/// @}
|
||||
|
|
Loading…
Reference in New Issue