Skip to content

Commit

Permalink
fix after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
perekopskiy committed Oct 14, 2024
1 parent d4f5d67 commit d8c6f4c
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions core/lib/vm_executor/src/batch/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ impl<S: ReadStorage, Tr: BatchTracer> BatchVm<S, Tr> {
mode: FastVmMode,
) -> Self {
if !is_supported_by_fast_vm(system_env.version) {
return Self::Legacy(LegacyVmInstance::new(l1_batch_env, system_env, storage_ptr));
return Self::Legacy(LegacyVmInstance::new(
l1_batch_env,
system_env,
storage_ptr,
pubdata_builder,
));
}

match mode {
Expand Down Expand Up @@ -470,7 +475,9 @@ impl<S: ReadStorage + 'static, Tr: BatchTracer> CommandReceiver<S, Tr> {
#[cfg(test)]
mod tests {
use assert_matches::assert_matches;
use zksync_multivm::interface::{storage::InMemoryStorage, TxExecutionMode};
use zksync_multivm::interface::{
pubdata::rollup::RollupPubdataBuilder, storage::InMemoryStorage, TxExecutionMode,
};
use zksync_types::ProtocolVersionId;

use super::*;
Expand All @@ -489,6 +496,7 @@ mod tests {
l1_batch_env.clone(),
system_env.clone(),
storage.clone(),
Some(Rc::new(RollupPubdataBuilder::new(Default::default()))),
mode,
);
assert_matches!(vm, BatchVm::Legacy(_));
Expand All @@ -499,17 +507,25 @@ mod tests {
l1_batch_env.clone(),
system_env.clone(),
storage.clone(),
Some(Rc::new(RollupPubdataBuilder::new(Default::default()))),
FastVmMode::Old,
);
assert_matches!(vm, BatchVm::Legacy(_));
let vm = BatchVm::<_, ()>::new(
l1_batch_env.clone(),
system_env.clone(),
storage.clone(),
Some(Rc::new(RollupPubdataBuilder::new(Default::default()))),
FastVmMode::New,
);
assert_matches!(vm, BatchVm::Fast(FastVmInstance::Fast(_)));
let vm = BatchVm::<_, ()>::new(l1_batch_env, system_env, storage, FastVmMode::Shadow);
let vm = BatchVm::<_, ()>::new(
l1_batch_env,
system_env,
storage,
Some(Rc::new(RollupPubdataBuilder::new(Default::default()))),
FastVmMode::Shadow,
);
assert_matches!(vm, BatchVm::Fast(FastVmInstance::Shadowed(_)));
}
}

0 comments on commit d8c6f4c

Please sign in to comment.