Skip to content

Commit

Permalink
fix: update function visibility in consistency_checker tests (#137)
Browse files Browse the repository at this point in the history
* Add example: build_commit_tx_input_data_is_correct (fails)

* Abstract normal_checker_function test

* Abstract checker_processes_pre_boojum_batches

* Abstract checker_functions_after_snapshot_recovery test

* Abstract checker_functions_after_snapshot_recovery test

* Remove unnecessary auxiliar function

* Fix all the failing tests

* Use test_helpers module

* Remove ValidiumModeL1BatchCommitDataGenerator fix

* Add bytes pubdata with 0 value for the encoding (#136)

* Fix unnecessary pub
  • Loading branch information
jordibonet-lambdaclass authored Feb 15, 2024
1 parent d31d1a6 commit b693293
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/lib/zksync_core/src/consistency_checker/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ fn extracting_commit_data_for_pre_boojum_batch() {
}

#[derive(Debug, Clone, Copy)]
pub enum SaveAction<'a> {
pub(crate) enum SaveAction<'a> {
InsertBatch(&'a L1BatchWithMetadata),
SaveMetadata(&'a L1BatchWithMetadata),
InsertCommitTx(L1BatchNumber),
Expand Down Expand Up @@ -332,7 +332,7 @@ async fn checker_functions_after_snapshot_recovery(delay_batch_insertion: bool)
}

#[derive(Debug, Clone, Copy)]
pub enum IncorrectDataKind {
pub(crate) enum IncorrectDataKind {
MissingStatus,
MismatchedStatus,
BogusCommitDataFormat,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use zksync_types::{web3::contract::Options, L2ChainId, ProtocolVersion};
use super::*;
use crate::genesis::{ensure_genesis_state, GenesisParams};

pub fn build_commit_tx_input_data_is_correct(

pub(crate) fn build_commit_tx_input_data_is_correct(
l1_batch_commit_data_generator: Arc<dyn L1BatchCommitDataGenerator>,
) {
let contract = zksync_contracts::zksync_contract();
Expand Down Expand Up @@ -35,7 +36,7 @@ pub fn build_commit_tx_input_data_is_correct(
}
}

pub async fn normal_checker_function(
pub(crate) async fn normal_checker_function(
batches_per_transaction: usize,
(mapper_name, save_actions_mapper): (&'static str, SaveActionMapper),
l1_batch_commit_data_generator: Arc<dyn L1BatchCommitDataGenerator>,
Expand Down Expand Up @@ -104,7 +105,7 @@ pub async fn normal_checker_function(
checker_task.await.unwrap().unwrap();
}

pub async fn checker_processes_pre_boojum_batches(
pub(crate) async fn checker_processes_pre_boojum_batches(
(mapper_name, save_actions_mapper): (&'static str, SaveActionMapper),
l1_batch_commit_data_generator: Arc<dyn L1BatchCommitDataGenerator>,
) {
Expand Down Expand Up @@ -250,7 +251,7 @@ pub async fn checker_functions_after_snapshot_recovery(
checker_task.await.unwrap().unwrap();
}

pub async fn checker_detects_incorrect_tx_data(
pub(crate) async fn checker_detects_incorrect_tx_data(
kind: IncorrectDataKind,
snapshot_recovery: bool,
l1_batch_commit_data_generator: Arc<dyn L1BatchCommitDataGenerator>,
Expand Down

0 comments on commit b693293

Please sign in to comment.