-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat(zk_toolbox): Make chain init independent from ecosystem #3231
Conversation
…/zksync-era into matias/separate-chain-create
…bs/zksync-era into matias/separate-chain-create
…bs/zksync-era into matias/separate-chain-create
…/zksync-era into matias/separate-chain-init
…/zksync-era into matias/separate-chain-init
) -> 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(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not contracts path
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
537a33b
There was a problem hiding this comment.
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?
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(), | ||
); | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
…bs/zksync-era into matias/separate-chain-create
…/zksync-era into matias/separate-chain-init
…bs/zksync-era into matias/separate-chain-create
…/zksync-era into matias/separate-chain-init
…in subcommand (#3322) ## What ❔ Preload chain and ecosystem config before each chain subcommand
What ❔
Why ❔
Checklist
zkstack dev fmt
andzkstack dev lint
.