Skip to content

Commit

Permalink
fix(zkstack_cli): Fix fmt --check (#3027)
Browse files Browse the repository at this point in the history
## What ❔

`fmt --check` wasn't returning an error code when failing
  • Loading branch information
matias-gonz authored Oct 7, 2024
1 parent f6d86bd commit 57d658e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
defaults::LOCAL_RPC_URL,
messages::{
MSG_GENESIS_ARGS_HELP, MSG_L1_RPC_URL_HELP, MSG_L1_RPC_URL_INVALID_ERR,
MSG_L1_RPC_URL_PROMPT, MSG_NO_PORT_REALLOCATION_HELP
MSG_L1_RPC_URL_PROMPT, MSG_NO_PORT_REALLOCATION_HELP,
},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use anyhow::Context;
use common::logger;
use config::{
copy_configs, set_l1_rpc_url, update_from_chain_config,
ChainConfig, ContractsConfig, EcosystemConfig,
traits::SaveConfigWithBasePath,
DEFAULT_CONSENSUS_PORT,
copy_configs, set_l1_rpc_url, traits::SaveConfigWithBasePath, update_from_chain_config,
ChainConfig, ContractsConfig, EcosystemConfig, DEFAULT_CONSENSUS_PORT,
};
use ethers::types::Address;
use xshell::Shell;
Expand Down
4 changes: 2 additions & 2 deletions zk_toolbox/crates/zk_inception/src/commands/chain/init/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub async fn init(
let init_configs_args = InitConfigsArgsFinal::from_chain_init_args(init_args);
let mut contracts_config =
init_configs(&init_configs_args, shell, ecosystem_config, chain_config).await?;

// Fund some wallet addresses with ETH or base token (only for Localhost)
distribute_eth(ecosystem_config, chain_config, init_args.l1_rpc_url.clone()).await?;
mint_base_token(ecosystem_config, chain_config, init_args.l1_rpc_url.clone()).await?;
Expand Down Expand Up @@ -178,6 +178,6 @@ pub async fn init(
genesis(init_args.genesis_args.clone(), shell, chain_config)
.await
.context(MSG_GENESIS_DATABASE_ERR)?;

Ok(())
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use crate::{
messages::{
MSG_DEPLOY_ECOSYSTEM_PROMPT, MSG_DEPLOY_ERC20_PROMPT, MSG_DEV_ARG_HELP,
MSG_GENESIS_ARGS_HELP, MSG_L1_RPC_URL_HELP, MSG_L1_RPC_URL_INVALID_ERR,
MSG_L1_RPC_URL_PROMPT, MSG_OBSERVABILITY_HELP, MSG_OBSERVABILITY_PROMPT,
MSG_NO_PORT_REALLOCATION_HELP,
MSG_L1_RPC_URL_PROMPT, MSG_NO_PORT_REALLOCATION_HELP, MSG_OBSERVABILITY_HELP,
MSG_OBSERVABILITY_PROMPT,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ async fn init_chains(
genesis_args: genesis_args.clone(),
deploy_paymaster,
l1_rpc_url: Some(final_init_args.ecosystem.l1_rpc_url.clone()),
no_port_reallocation: final_init_args.no_port_reallocation
no_port_reallocation: final_init_args.no_port_reallocation,
};
let final_chain_init_args = chain_init_args.fill_values_with_prompt(&chain_config);

Expand Down
11 changes: 3 additions & 8 deletions zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,9 @@ pub async fn run(shell: Shell, args: FmtArgs) -> anyhow::Result<()> {
)));
tasks.push(tokio::spawn(prettier_contracts(shell.clone(), args.check)));

futures::future::join_all(tasks)
.await
.iter()
.for_each(|res| {
if let Err(err) = res {
logger::error(err)
}
});
for result in futures::future::join_all(tasks).await {
result??;
}
}
Some(Formatter::Prettier { mut targets }) => {
if targets.is_empty() {
Expand Down

0 comments on commit 57d658e

Please sign in to comment.