Skip to content

Commit

Permalink
feat: add raw_get to vm::testing::Contract
Browse files Browse the repository at this point in the history
  • Loading branch information
loloicci committed Apr 6, 2022
1 parent abc91a4 commit b196b94
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/vm/src/testing/contract.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use wasmer::Module;

use crate::backend::Backend;
use crate::backend::{Backend, Storage};
use crate::compatibility::check_wasm;
use crate::instance::Instance;
use crate::wasm_backend::compile;
Expand Down Expand Up @@ -81,6 +81,14 @@ impl Contract {
self.storage = backend.storage;
Ok(())
}

/// get value from storage
pub fn raw_get(
&self,
key: &[u8],
) -> Option<Vec<u8>> {
self.storage.get(key).0.unwrap()
}
}

#[cfg(test)]
Expand Down

0 comments on commit b196b94

Please sign in to comment.