Type Definition casper_engine_test_support::LmdbWasmTestBuilder
source · [−]pub type LmdbWasmTestBuilder = WasmTestBuilder<LmdbGlobalState>;
Expand description
Wasm test builder where state is held in LMDB.
Implementations
sourceimpl LmdbWasmTestBuilder
impl LmdbWasmTestBuilder
sourcepub fn new_with_config<T: AsRef<OsStr> + ?Sized>(
data_dir: &T,
engine_config: EngineConfig
) -> Self
pub fn new_with_config<T: AsRef<OsStr> + ?Sized>(
data_dir: &T,
engine_config: EngineConfig
) -> Self
Returns an LmdbWasmTestBuilder
with configuration.
sourcepub fn flush_environment(&self)
pub fn flush_environment(&self)
Flushes the LMDB environment to disk.
sourcepub fn open<T: AsRef<OsStr> + ?Sized>(
data_dir: &T,
engine_config: EngineConfig,
post_state_hash: Digest
) -> Self
pub fn open<T: AsRef<OsStr> + ?Sized>(
data_dir: &T,
engine_config: EngineConfig,
post_state_hash: Digest
) -> Self
Creates a new instance of builder using the supplied configurations, opening wrapped LMDBs (e.g. in the Trie and Data stores) rather than creating them.
sourcepub fn open_raw<T: AsRef<Path>>(
global_state_dir: T,
engine_config: EngineConfig,
post_state_hash: Digest
) -> Self
pub fn open_raw<T: AsRef<Path>>(
global_state_dir: T,
engine_config: EngineConfig,
post_state_hash: Digest
) -> Self
Creates a new instance of builder using the supplied configurations, opening wrapped LMDBs
(e.g. in the Trie and Data stores) rather than creating them.
Differs from open
in that it doesn’t append GLOBAL_STATE_DIR
to the supplied path.
sourcepub fn lmdb_on_disk_size(&self) -> Option<u64>
pub fn lmdb_on_disk_size(&self) -> Option<u64>
Returns the file size on disk of the backing lmdb file behind LmdbGlobalState.
sourcepub fn scratch_exec_and_commit(
&mut self,
exec_request: ExecuteRequest
) -> &mut Self
pub fn scratch_exec_and_commit(
&mut self,
exec_request: ExecuteRequest
) -> &mut Self
Execute and commit transforms from an ExecuteRequest into a scratch global state. You MUST call write_scratch_to_lmdb to flush these changes to LmdbGlobalState.
sourcepub fn write_scratch_to_db(&mut self) -> &mut Self
pub fn write_scratch_to_db(&mut self) -> &mut Self
Commit scratch to global state, and reset the scratch cache.
sourcepub fn step_with_scratch(&mut self, step_request: StepRequest) -> &mut Self
pub fn step_with_scratch(&mut self, step_request: StepRequest) -> &mut Self
run step against scratch global state.