mirror of https://github.com/status-im/evmc.git
Merge pull request #67 from ethereum/execute-helper
Add evmc_execute helper
This commit is contained in:
commit
3730cfc6a8
|
@ -52,7 +52,7 @@ static struct evmc_result execute_wrapper(struct evmc_instance* instance, int64_
|
|||
};
|
||||
|
||||
struct extended_context ctx = {{&evmc_go_fn_table}, context_index};
|
||||
return instance->execute(instance, &ctx.context, rev, &msg, code, code_size);
|
||||
return evmc_execute(instance, &ctx.context, rev, &msg, code, code_size);
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
|
|
@ -190,7 +190,7 @@ int main()
|
|||
msg.gas = gas;
|
||||
msg.depth = 0;
|
||||
|
||||
struct evmc_result result = vm->execute(vm, &ctx, EVMC_HOMESTEAD, &msg, code, code_size);
|
||||
struct evmc_result result = evmc_execute(vm, &ctx, EVMC_HOMESTEAD, &msg, code, code_size);
|
||||
|
||||
printf("Execution result:\n");
|
||||
if (result.status_code != EVMC_SUCCESS)
|
||||
|
|
|
@ -41,6 +41,21 @@ static inline int evmc_set_option(struct evmc_instance* instance,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes code in the VM instance.
|
||||
*
|
||||
* @see evmc_execute_fn.
|
||||
*/
|
||||
static inline struct evmc_result evmc_execute(struct evmc_instance* instance,
|
||||
struct evmc_context* context,
|
||||
enum evmc_revision rev,
|
||||
const struct evmc_message* msg,
|
||||
uint8_t const* code,
|
||||
size_t code_size)
|
||||
{
|
||||
return instance->execute(instance, context, rev, msg, code, code_size);
|
||||
}
|
||||
|
||||
/**
|
||||
* Releases the resources allocated to the execution result.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue