Skip to content

Commit

Permalink
Document tester
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Oct 15, 2024
1 parent 2ebac02 commit b67372d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions core/lib/multivm/src/versions/testonly/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
//! Reusable tests and tooling for low-level VM testing.
//!
//! # How it works
//!
//! - [`TestedVm`] defines test-specific VM extensions. It's currently implemented for the latest legacy VM
//! (`vm_latest`) and the fast VM (`vm_fast`).
//! - Submodules of this module define test functions generic by `TestedVm`. Specific VM versions implement `TestedVm`
//! and can create tests based on these test functions with minimum amount of boilerplate code.

use ethabi::Contract;
use once_cell::sync::Lazy;
use zksync_contracts::{
Expand Down
3 changes: 2 additions & 1 deletion core/lib/multivm/src/versions/testonly/tester/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use crate::{

mod transaction_test_info;

/// VM tester that provides prefunded accounts, storage handle etc.
#[derive(Debug)]
pub(crate) struct VmTester<VM> {
pub(crate) vm: VM,
Expand Down Expand Up @@ -64,6 +65,7 @@ impl<VM: TestedVm> VmTester<VM> {
}
}

/// Builder for [`VmTester`].
#[derive(Debug)]
pub(crate) struct VmTesterBuilder {
storage: Option<InMemoryStorage>,
Expand Down Expand Up @@ -200,7 +202,6 @@ pub(crate) trait TestedVm:
/// Returns `true` iff the decommit is fresh.
fn manually_decommit(&mut self, code_hash: H256) -> bool;

// FIXME: u32 -> usize
fn verify_required_bootloader_heap(&self, cells: &[(u32, U256)]);

fn write_to_bootloader_heap(&mut self, cells: &[(usize, U256)]);
Expand Down

0 comments on commit b67372d

Please sign in to comment.