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

feat(zk_toolbox): Make chain init independent from ecosystem #3231

Merged
merged 71 commits into from
Nov 26, 2024

Conversation

matias-gonz
Copy link
Collaborator

What ❔

Why ❔

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zkstack dev fmt and zkstack dev lint.

…/zksync-era into matias/separate-chain-create
…bs/zksync-era into matias/separate-chain-create
…bs/zksync-era into matias/separate-chain-create
@matias-gonz matias-gonz changed the title feat(zk_toolbox): [WIP] Make chain init independent from ecosystem feat(zk_toolbox): Make chain init independent from ecosystem Nov 20, 2024
@matias-gonz matias-gonz marked this pull request as ready for review November 20, 2024 00:13
) -> anyhow::Result<PathBuf> {
let ecosystem_preexisting_configs_path = ecosystem.map_or_else(
|| chain.get_preexisting_ecosystem_contracts_path(),
|e| e.get_preexisting_ecosystem_contracts_path(),
Copy link
Contributor

Choose a reason for hiding this comment

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

why not contracts path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed!
537a33b

Copy link
Contributor

Choose a reason for hiding this comment

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

hm, but why do we actually need this map? why not always use chain?

Comment on lines +95 to +118
let ecosystem_contracts_path = if self.dev {
self.ecosystem_contracts_path.map_or_else(
|| {
ecosystem.as_ref().map_or_else(
|| chain.get_preexisting_ecosystem_contracts_path(),
|e| e.get_contracts_path(),
)
},
PathBuf::from,
)
} else if let Some(ecosystem) = &ecosystem {
ecosystem.get_contracts_path()
} else {
get_ecosystem_contracts_path(self.ecosystem_contracts_path, ecosystem.clone(), chain)?
};

let wallets_path = ecosystem.map_or_else(
|| {
self.wallets_path
.map_or_else(|| Prompt::new(MSG_WALLETS_PATH_PROMPT).ask(), PathBuf::from)
},
|e| e.get_wallets_path(),
);

Copy link
Contributor

Choose a reason for hiding this comment

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

from messages it's not clear what contracts and wallets you want

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated the wallets message in: f194e18

Is this OK or what should the message be?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Prompt for contracts path is:
Provide the path to the ecosystem contracts or keep it empty and you will use ZKsync ecosystem config. For using this config, you need to have governance wallet
How can we improve it?

Base automatically changed from matias/separate-chain-create to matias/refactor-chain-commands November 26, 2024 14:10
@matias-gonz matias-gonz merged commit d6c3446 into matias/refactor-chain-commands Nov 26, 2024
31 checks passed
@matias-gonz matias-gonz deleted the matias/separate-chain-init branch November 26, 2024 14:49
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