From 2e7dccb23ef809c09d87dcf2be4a7bd82daf6889 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Apr 2019 12:20:24 +0100 Subject: [PATCH] examples: return an output buffer in Rust --- examples/example-rust-vm/src/lib.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/example-rust-vm/src/lib.rs b/examples/example-rust-vm/src/lib.rs index 5108f63..b37590a 100644 --- a/examples/example-rust-vm/src/lib.rs +++ b/examples/example-rust-vm/src/lib.rs @@ -10,10 +10,6 @@ extern "C" fn execute( code: *const u8, code_size: usize, ) -> ffi::evmc_result { - if msg == std::ptr::null() { - panic!() - } - let is_create = unsafe { (*msg).kind == ffi::evmc_call_kind::EVMC_CREATE }; if is_create { @@ -28,7 +24,7 @@ extern "C" fn execute( evmc_vm::ExecutionResult::new( ffi::evmc_status_code::EVMC_SUCCESS, 66, - None, + Some(vec![0xc0, 0xff, 0xee]), ffi::evmc_address { bytes: [0u8; 20] }, ) .into()