Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bindings/rust/evmc-vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ impl From<ExecutionResult> for ffi::evmc_result {
status_code: value.status_code,
gas_left: value.gas_left,
gas_refund: value.gas_refund,
growth_gas: 0,
output_data: buffer,
output_size: len,
release: Some(release_stack_result),
Expand Down Expand Up @@ -625,6 +626,7 @@ mod tests {
status_code: StatusCode::EVMC_SUCCESS,
gas_left: 1337,
gas_refund: 21,
growth_gas: 0,
output_data: Box::into_raw(Box::new([0xde, 0xad, 0xbe, 0xef])) as *const u8,
output_size: 4,
release: Some(test_result_dispose),
Expand Down Expand Up @@ -975,6 +977,7 @@ mod tests {
},
gas_left: 2,
gas_refund: 0,
growth_gas: 0,
// NOTE: we are passing the input pointer here, but for testing the lifetime is ok
output_data: msg.input_data,
output_size: msg.input_size,
Expand Down
8 changes: 6 additions & 2 deletions include/evmc/evmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,12 @@ struct evmc_result
*/
int64_t gas_refund;

/**
* Gas attributed to state growth accumulated during this execution and
* its sub-calls.
*/
uint64_t growth_gas;

/**
* The reference to output data.
*
Expand Down Expand Up @@ -506,8 +512,6 @@ struct evmc_result
* to be optionally used by the evmc_result object creator.
*
* @see evmc_result_optional_data, evmc_get_optional_data().
*
* Also extends the size of the evmc_result to 64 bytes (full cache line).
*/
uint8_t padding[4];
};
Expand Down