Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(zkstack): Preload chain and ecosystem config before each chain subcommand #3322

Open
wants to merge 5 commits into
base: matias/separate-chain-deploy-l2-contracts
Choose a base branch
from

Conversation

matias-gonz
Copy link
Collaborator

What ❔

Preload chain and ecosystem config before each chain subcommand

@matias-gonz matias-gonz changed the title feat(zkstack): Preload chain and ecosystem config before each chain subcommand refactor(zkstack): Preload chain and ecosystem config before each chain subcommand Nov 22, 2024
@@ -95,15 +95,19 @@ pub(crate) async fn run(shell: &Shell, cmd: ChainCommands) -> anyhow::Result<()>

match cmd {
ChainCommands::Create(args) => create::run(args, shell),
ChainCommands::Init(args) => init::run(*args, shell).await,
ChainCommands::BuildTransactions(args) => build_transactions::run(args, shell).await,
ChainCommands::Init(args) => init::run(*args, shell, chain, ecosystem).await,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work with create function?
based on what i see it should fail for create or you have to unwrap chain

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does because of this:
https://github.com/matter-labs/zksync-era/blob/matias/pre-load-ecosystem-and-chain/zkstack_cli/crates/zkstack/src/commands/chain/mod.rs#L89

I could remove create from the match clause to make it more clear that it will execute before

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment there and also add unreachable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants