Skip to content

Commit

Permalink
Add evmc_execute helper
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Aug 20, 2018
1 parent 58a8d22 commit 42aa977
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions include/evmc/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@

#include <evmc/evmc.h>

/**
* Executes the VM.
*
* @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);
}

/**
* Destroys the VM instance.
*
Expand Down

0 comments on commit 42aa977

Please sign in to comment.