Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit 42aa977

Browse files
committed
Add evmc_execute helper
1 parent 58a8d22 commit 42aa977

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

examples/capi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ int main()
190190
msg.gas = gas;
191191
msg.depth = 0;
192192

193-
struct evmc_result result = vm->execute(vm, &ctx, EVMC_HOMESTEAD, &msg, code, code_size);
193+
struct evmc_result result = evmc_execute(vm, &ctx, EVMC_HOMESTEAD, &msg, code, code_size);
194194

195195
printf("Execution result:\n");
196196
if (result.status_code != EVMC_SUCCESS)

include/evmc/helpers.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@
1717

1818
#include <evmc/evmc.h>
1919

20+
/**
21+
* Executes the VM.
22+
*
23+
* @see evmc_execute_fn.
24+
*/
25+
static inline struct evmc_result evmc_execute(struct evmc_instance* instance,
26+
struct evmc_context* context,
27+
enum evmc_revision rev,
28+
const struct evmc_message* msg,
29+
uint8_t const* code,
30+
size_t code_size);
31+
32+
{
33+
return instance->execute(instance, context, rev, msg, code, code_size);
34+
}
35+
2036
/**
2137
* Destroys the VM instance.
2238
*

0 commit comments

Comments
 (0)