Skip to content

Commit

Permalink
katana: replace block_time: None by default (#1858)
Browse files Browse the repository at this point in the history
Use default when possible
  • Loading branch information
tcoratger authored Apr 22, 2024
1 parent 10f7f9f commit d160479
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
11 changes: 3 additions & 8 deletions crates/katana/core/tests/sequencer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_primitives::U256;
use katana_core::backend::config::{Environment, StarknetConfig};
use katana_core::backend::config::StarknetConfig;
use katana_core::sequencer::{KatanaSequencer, SequencerConfig};
use katana_executor::implementation::noop::NoopExecutorFactory;
use katana_primitives::genesis::allocation::DevAllocationsGenerator;
Expand All @@ -17,13 +17,8 @@ fn create_test_sequencer_config() -> (SequencerConfig, StarknetConfig) {
genesis.extend_allocations(accounts.into_iter().map(|(k, v)| (k, v.into())));

(
SequencerConfig { block_time: None, ..Default::default() },
StarknetConfig {
genesis,
disable_fee: true,
env: Environment::default(),
..Default::default()
},
SequencerConfig::default(),
StarknetConfig { genesis, disable_fee: true, ..Default::default() },
)
}

Expand Down
6 changes: 3 additions & 3 deletions crates/katana/rpc/rpc/tests/saya.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mod common;
async fn no_pending_support() {
// Saya does not support the pending block and only work on sealed blocks.
let sequencer = TestSequencer::start(
SequencerConfig { block_time: None, no_mining: true, ..Default::default() },
SequencerConfig { no_mining: true, ..Default::default() },
get_default_test_starknet_config(),
)
.await;
Expand All @@ -47,7 +47,7 @@ async fn no_pending_support() {
async fn process_sealed_block_only() {
// Saya does not support the pending block and only work on sealed blocks.
let sequencer = TestSequencer::start(
SequencerConfig { block_time: None, no_mining: true, ..Default::default() },
SequencerConfig { no_mining: true, ..Default::default() },
get_default_test_starknet_config(),
)
.await;
Expand Down Expand Up @@ -118,7 +118,7 @@ async fn process_sealed_block_only() {
#[tokio::test(flavor = "multi_thread")]
async fn executions_chunks_logic_ok() {
let sequencer = TestSequencer::start(
SequencerConfig { block_time: None, no_mining: true, ..Default::default() },
SequencerConfig { no_mining: true, ..Default::default() },
get_default_test_starknet_config(),
)
.await;
Expand Down
4 changes: 2 additions & 2 deletions crates/katana/rpc/rpc/tests/torii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub const ENOUGH_GAS: &str = "0x100000000000000000";
#[tokio::test(flavor = "multi_thread")]
async fn test_get_transactions() {
let sequencer = TestSequencer::start(
SequencerConfig { block_time: None, no_mining: true, ..Default::default() },
SequencerConfig { no_mining: true, ..Default::default() },
get_default_test_starknet_config(),
)
.await;
Expand Down Expand Up @@ -176,7 +176,7 @@ async fn test_get_transactions() {
#[tokio::test(flavor = "multi_thread")]
async fn test_get_transactions_with_instant_mining() {
let sequencer = TestSequencer::start(
SequencerConfig { block_time: None, no_mining: false, ..Default::default() },
SequencerConfig { no_mining: false, ..Default::default() },
get_default_test_starknet_config(),
)
.await;
Expand Down

0 comments on commit d160479

Please sign in to comment.