mirror of
https://github.com/status-im/evmc.git
synced 2025-02-23 00:18:24 +00:00
Add evmc_execute helper
This commit is contained in:
parent
58a8d2295d
commit
f014e4fc77
@ -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};
|
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"
|
import "C"
|
||||||
|
@ -190,7 +190,7 @@ int main()
|
|||||||
msg.gas = gas;
|
msg.gas = gas;
|
||||||
msg.depth = 0;
|
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");
|
printf("Execution result:\n");
|
||||||
if (result.status_code != EVMC_SUCCESS)
|
if (result.status_code != EVMC_SUCCESS)
|
||||||
|
@ -41,6 +41,21 @@ static inline int evmc_set_option(struct evmc_instance* instance,
|
|||||||
return 0;
|
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.
|
* Releases the resources allocated to the execution result.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user