mirror of https://github.com/status-im/evmc.git
examples: return an output buffer in Rust
This commit is contained in:
parent
45996842e2
commit
2e7dccb23e
|
@ -10,10 +10,6 @@ extern "C" fn execute(
|
||||||
code: *const u8,
|
code: *const u8,
|
||||||
code_size: usize,
|
code_size: usize,
|
||||||
) -> ffi::evmc_result {
|
) -> ffi::evmc_result {
|
||||||
if msg == std::ptr::null() {
|
|
||||||
panic!()
|
|
||||||
}
|
|
||||||
|
|
||||||
let is_create = unsafe { (*msg).kind == ffi::evmc_call_kind::EVMC_CREATE };
|
let is_create = unsafe { (*msg).kind == ffi::evmc_call_kind::EVMC_CREATE };
|
||||||
|
|
||||||
if is_create {
|
if is_create {
|
||||||
|
@ -28,7 +24,7 @@ extern "C" fn execute(
|
||||||
evmc_vm::ExecutionResult::new(
|
evmc_vm::ExecutionResult::new(
|
||||||
ffi::evmc_status_code::EVMC_SUCCESS,
|
ffi::evmc_status_code::EVMC_SUCCESS,
|
||||||
66,
|
66,
|
||||||
None,
|
Some(vec![0xc0, 0xff, 0xee]),
|
||||||
ffi::evmc_address { bytes: [0u8; 20] },
|
ffi::evmc_address { bytes: [0u8; 20] },
|
||||||
)
|
)
|
||||||
.into()
|
.into()
|
||||||
|
|
Loading…
Reference in New Issue