Sfoglia il codice sorgente

runtime: Remove unused sanity_check() function

This is now done inside the deployooor contract.
parazyd 2 anni fa
parent
commit
e102f84e56
2 ha cambiato i file con 2 aggiunte e 16 eliminazioni
  1. 2 1
      src/runtime/memory.rs
  2. 0 15
      src/runtime/vm_runtime.rs

+ 2 - 1
src/runtime/memory.rs

@@ -39,8 +39,9 @@ impl<'a> MemoryManipulation for MemoryView<'a> {
 #[cfg(test)]
 mod tests {
     use super::*;
-    use darkfi_serial::Decodable;
     use std::io::Cursor;
+
+    use darkfi_serial::Decodable;
     use wasmer::{Memory, MemoryType, Store, WasmPtr};
 
     #[test]

+ 0 - 15
src/runtime/vm_runtime.rs

@@ -305,21 +305,6 @@ impl Runtime {
         Ok(Self { instance, store, ctx })
     }
 
-    /// Perform a sanity check of the WASM bincode. In particular, ensure that it contains
-    /// all the necessary symbols for executing contracts, including sections for
-    /// Deploy, Exec, Update, and Metadata.
-    pub fn sanity_check(&self) -> Result<()> {
-        debug!(target: "runtime::vm_runtime", "Performing sanity check on wasm bincode");
-
-        // Check that we have all the necessary symbols;
-        let _ = self.instance.exports.get_function(ContractSection::Deploy.name())?;
-        let _ = self.instance.exports.get_function(ContractSection::Exec.name())?;
-        let _ = self.instance.exports.get_function(ContractSection::Update.name())?;
-        let _ = self.instance.exports.get_function(ContractSection::Metadata.name())?;
-
-        Ok(())
-    }
-
     /// Call a contract method defined by a [`ContractSection`] using a supplied
     /// payload. Returns a Vector of bytes corresponding to the result data of the call.
     /// For calls that do not return any data, an empty Vector is returned.