EVM-C: reorder and add create_address to evm_result

This commit is contained in:
Paweł Bylica 2016-09-28 13:19:02 +02:00
parent 8b9867c971
commit aceb7af658
1 changed files with 28 additions and 15 deletions

View File

@ -77,23 +77,25 @@ struct evm_result {
/// The value is valid only if evm_result::code == ::EVM_SUCCESS. /// The value is valid only if evm_result::code == ::EVM_SUCCESS.
int64_t gas_left; int64_t gas_left;
/// The reference to output data. The memory containing the output data union
/// is owned by EVM and is freed with evm_release_result_fn(). {
struct
{
/// The reference to output data. The memory containing the output
/// data is owned by EVM and is freed with evm_result::release().
uint8_t const* output_data; uint8_t const* output_data;
/// The size of the output data. /// The size of the output data.
size_t output_size; size_t output_size;
};
/// @name Optional /// The address of the successfully created contract.
/// The optional information that EVM is not required to provide. ///
/// @{ /// This field has valid value only if the evm_result comes from a
/// successful CREATE opcode execution
/// The pointer to EVM-owned memory. For EVM internal use. /// (i.e. evm_call_fn(..., EVM_CREATE, ...)).
/// @see output_data. struct evm_uint160be create_address;
void* internal_memory; };
/// The error message explaining the result code.
char const* error_message;
/// The pointer to the result release implementation. /// The pointer to the result release implementation.
/// ///
@ -102,6 +104,17 @@ struct evm_result {
/// itself allows VM composition. /// itself allows VM composition.
evm_release_result_fn release; evm_release_result_fn release;
/// @name Optional
/// The optional information that EVM is not required to provide.
/// @{
/// The error message explaining the result code.
char const* error_message;
/// The pointer to EVM-owned memory. For EVM internal use.
/// @see output_data.
void* internal_memory;
/// @} /// @}
}; };