x 3 лет назад
Родитель
Сommit
48f1a86d58

+ 1 - 0
example/smart-contract/src/lib.rs

@@ -65,3 +65,4 @@ fn process_instruction(ix: &[u8]) -> ContractResult {
 
     Ok(())
 }
+

+ 0 - 1
example/smart-contract/tests/runtime.rs

@@ -36,7 +36,6 @@ fn run_contract() -> Result<()> {
         simplelog::TerminalMode::Mixed,
         simplelog::ColorChoice::Auto,
     )?;
-
     // =============================================================
     // Build a ledger state so the runtime has something to work on
     // =============================================================

+ 1 - 0
src/runtime/vm_runtime.rs

@@ -165,6 +165,7 @@ impl Runtime {
         let entrypoint = self.instance.exports.get_function(ENTRYPOINT)?;
 
         debug!(target: "wasm_runtime::run", "Executing wasm");
+        // We pass 0 to entrypoint() which is the location of the payload data in the memory
         let ret = match entrypoint.call(&mut self.store, &[Value::I32(0 as i32)]) {
             Ok(retvals) => {
                 self.print_logs();