From db1908d07e5dcacbfee325f78e0af0d8c4bd1ea8 Mon Sep 17 00:00:00 2001 From: parazyd Date: Sat, 25 Feb 2023 13:14:28 +0100 Subject: [PATCH] runtime: Add documentation for metadata function. --- src/runtime/vm_runtime.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/runtime/vm_runtime.rs b/src/runtime/vm_runtime.rs index 48d0bd7b8..37c5af2f6 100644 --- a/src/runtime/vm_runtime.rs +++ b/src/runtime/vm_runtime.rs @@ -121,6 +121,7 @@ impl Runtime { /// Create a new wasm runtime instance that contains the given wasm module. pub fn new(wasm_bytes: &[u8], blockchain: Blockchain, contract_id: ContractId) -> Result { info!(target: "runtime::vm_runtime", "Instantiating a new runtime"); + // TODO: Add necessary operators // This function will be called for each `Operator` encountered during // the wasm module execution. It should return the cost of the operator // that it received as its first argument. @@ -376,6 +377,10 @@ impl Runtime { Ok(()) } + /// This function runs first in the entire scheme of executing a smart contract. + /// It is supposed to correctly extract public inputs for any ZK proofs included + /// in the contract calls, and also extract the public keys used to verify the + /// call/transaction signatures. pub fn metadata(&mut self, payload: &[u8]) -> Result> { self.call(ContractSection::Metadata, payload) }