From 8036cdca37d59f636f497d7ebe54f9c31f780f45 Mon Sep 17 00:00:00 2001 From: th4s Date: Thu, 27 Jan 2022 19:51:51 +0100 Subject: [PATCH 1/2] Removed once_cell --- vm/Cargo.toml | 1 - vm/src/program.rs | 2 +- vm/src/stoffel_vm.rs | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 1014137..fe7e762 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -13,4 +13,3 @@ tokio = {version = "0.2", features = ["full"] } ark-ff = "0.3" ark-poly = "0.3" ark-ec = "0.3" -once_cell = "1.9" diff --git a/vm/src/program.rs b/vm/src/program.rs index dd7cfbc..6970d43 100644 --- a/vm/src/program.rs +++ b/vm/src/program.rs @@ -8,7 +8,7 @@ impl Program { Program(vec![]) } - fn parse(&mut self, bytes: impl AsRef<[u8]>) { + pub fn parse_bytes(&mut self, bytes: impl AsRef<[u8]>) { todo!(); } diff --git a/vm/src/stoffel_vm.rs b/vm/src/stoffel_vm.rs index 73abf17..2e09892 100644 --- a/vm/src/stoffel_vm.rs +++ b/vm/src/stoffel_vm.rs @@ -1,6 +1,7 @@ use super::processors::{ArithmeticProcessor, BooleanProcessor, Processor}; use super::program::Program; use super::state::GlobalMemory; +use std::lazy::Lazy; use std::sync::{Arc, Mutex}; use types::numbers::{Number, SecretSharing}; @@ -36,7 +37,7 @@ impl Stoff } pub fn load_byte_code(&mut self, bytes: impl AsRef<[u8]>) { - todo!(); + self.code.parse_bytes(bytes.as_ref()) } pub fn execute(&mut self) -> i32 { From 577f8a812096635a545cd7527a0870bdd079edb8 Mon Sep 17 00:00:00 2001 From: th4s Date: Thu, 27 Jan 2022 19:52:49 +0100 Subject: [PATCH 2/2] Remove use of std::lazy --- vm/src/stoffel_vm.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/vm/src/stoffel_vm.rs b/vm/src/stoffel_vm.rs index 2e09892..9c2bcac 100644 --- a/vm/src/stoffel_vm.rs +++ b/vm/src/stoffel_vm.rs @@ -1,7 +1,6 @@ use super::processors::{ArithmeticProcessor, BooleanProcessor, Processor}; use super::program::Program; use super::state::GlobalMemory; -use std::lazy::Lazy; use std::sync::{Arc, Mutex}; use types::numbers::{Number, SecretSharing};