Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
azurwastaken committed Sep 17, 2024
1 parent 6a68537 commit a8d316c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion crates/client/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ mod tests {
use mp_receipt::{Event, ExecutionResult, FeePayment, InvokeTransactionReceipt, PriceUnit, TransactionReceipt};
use mp_transactions::broadcasted_to_blockifier;
use mp_transactions::compute_hash::calculate_contract_address;
use mp_utils::tests_common::*;
use rstest::{fixture, rstest};
use starknet_core::types::contract::SierraClass;
use starknet_core::types::{
Expand All @@ -219,7 +220,6 @@ mod tests {
BroadcastedTransaction, DataAvailabilityMode, DeclareTransactionResult, DeployAccountTransactionResult,
FlattenedSierraClass, InvokeTransactionResult, ResourceBounds, ResourceBoundsMapping,
};
use mp_utils::tests_common::*;
use std::sync::Arc;

struct DevnetForTesting {
Expand Down
30 changes: 15 additions & 15 deletions crates/node/src/cli/chain_config_overrides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,49 +37,49 @@ pub struct ChainConfigOverrideParams {
impl ChainConfigOverrideParams {
pub fn override_cfg(&self, mut chain_config: ChainConfig) -> ChainConfig {
let params = self.clone();

if let Some(name) = params.chain_name {
chain_config.chain_name = name;
}

if let Some(id) = params.chain_id {
chain_config.chain_id = ChainId::from(id);
}

if let Some(address) = params.native_fee_token_address {
chain_config.native_fee_token_address = contract_address!(address.as_str());
}

if let Some(address) = params.parent_fee_token_address {
chain_config.parent_fee_token_address = contract_address!(address.as_str());
}

if let Some(version) = params.latest_protocol_version {
chain_config.latest_protocol_version = StarknetVersion::from_str(version.as_str())
.expect("failed to retrieve version");
chain_config.latest_protocol_version =
StarknetVersion::from_str(version.as_str()).expect("failed to retrieve version");
}

if let Some(time) = params.block_time {
chain_config.block_time = Duration::from_secs(time);
}

if let Some(time) = self.pending_block_update_time {
chain_config.pending_block_update_time = Duration::from_secs(time);
}

if let Some(address) = params.sequencer_address {
chain_config.sequencer_address = contract_address!(address.as_str());
}

if let Some(max_nonce) = params.max_nonce_for_validation_skip {
chain_config.max_nonce_for_validation_skip = max_nonce;
}

if let Some(address) = params.eth_core_contract_address {
chain_config.eth_core_contract_address = H160::from_str(address.as_str())
.expect("failed to parse core contract");
chain_config.eth_core_contract_address =
H160::from_str(address.as_str()).expect("failed to parse core contract");
}

chain_config
}
}
4 changes: 2 additions & 2 deletions crates/primitives/utils/src/tests_common.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::{env, path::PathBuf};
use rstest::fixture;
use std::{env, path::PathBuf};

#[fixture]
pub fn set_workdir() {
Expand All @@ -14,4 +14,4 @@ pub fn set_workdir() {
let project_root = PathBuf::from(cargo_toml_path.trim()).parent().unwrap().to_path_buf();

env::set_current_dir(&project_root).expect("Failed to set working directory");
}
}
2 changes: 1 addition & 1 deletion crates/tests/src/rpc/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mod test_rpc_read_calls {
use rstest::rstest;
use std::any::Any;

use crate::set_workdir;
use crate::{MadaraCmd, MadaraCmdBuilder};
use flate2::read::GzDecoder;
use starknet::macros::felt;
Expand All @@ -31,7 +32,6 @@ mod test_rpc_read_calls {
use std::io::BufReader;
use std::io::Read;
use tokio::sync::OnceCell;
use crate::set_workdir;

static MADARA: Lazy<OnceCell<MadaraCmd>> = Lazy::new(OnceCell::new);

Expand Down

0 comments on commit a8d316c

Please sign in to comment.