Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
toni-calvin committed Feb 23, 2024
1 parent ce6247e commit 57f4bbe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions core/bin/external_node/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use anyhow::Context;
use serde::Deserialize;
use url::Url;
use zksync_basic_types::{Address, L1ChainId, L2ChainId};
use zksync_config::{configs::chain::L1BatchCommitDataGeneratorMode, ObjectStoreConfig};
use zksync_consensus_roles::node;
use zksync_core::{
api_server::{
Expand All @@ -19,8 +20,6 @@ use zksync_web3_decl::{
namespaces::{EthNamespaceClient, ZksNamespaceClient},
};

use zksync_config::{configs::chain::L1BatchCommitDataGeneratorMode, ObjectStoreConfig};

#[cfg(test)]
mod tests;

Expand Down
9 changes: 9 additions & 0 deletions core/bin/external_node/src/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ fn parsing_optional_config_from_empty_env() {
128 * BYTES_IN_MEGABYTE
);
assert_eq!(config.max_response_body_size(), 10 * BYTES_IN_MEGABYTE);
assert_eq!(
config.l1_batch_commit_data_generator_mode,
L1BatchCommitDataGeneratorMode::Rollup
);
}

#[test]
Expand All @@ -44,6 +48,7 @@ fn parsing_optional_config_from_env() {
("EN_MERKLE_TREE_MULTI_GET_CHUNK_SIZE", "1000"),
("EN_MERKLE_TREE_BLOCK_CACHE_SIZE_MB", "32"),
("EN_MAX_RESPONSE_BODY_SIZE_MB", "1"),
("EN_L1_BATCH_COMMIT_DATA_GENERATOR_MODE", "Validium"),
];
let env_vars = env_vars
.into_iter()
Expand All @@ -70,4 +75,8 @@ fn parsing_optional_config_from_env() {
32 * BYTES_IN_MEGABYTE
);
assert_eq!(config.max_response_body_size(), BYTES_IN_MEGABYTE);
assert_eq!(
config.l1_batch_commit_data_generator_mode,
L1BatchCommitDataGeneratorMode::Validium
);
}

0 comments on commit 57f4bbe

Please sign in to comment.