-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93bc66f
commit 859ce92
Showing
12 changed files
with
326 additions
and
151 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
zk_toolbox/crates/zk_inception/src/commands/chain/accept_chain_ownership.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use anyhow::Context; | ||
use common::{config::global_config, forge::ForgeScriptArgs, logger, spinner::Spinner}; | ||
use config::EcosystemConfig; | ||
use xshell::Shell; | ||
|
||
use crate::{ | ||
accept_ownership::accept_admin, | ||
messages::{ | ||
MSG_ACCEPTING_ADMIN_SPINNER, MSG_CHAIN_NOT_INITIALIZED, MSG_CHAIN_OWNERSHIP_TRANSFERRED, | ||
MSG_L1_SECRETS_MUST_BE_PRESENTED, | ||
}, | ||
}; | ||
|
||
pub async fn run(args: ForgeScriptArgs, shell: &Shell) -> anyhow::Result<()> { | ||
let chain_name = global_config().chain_name.clone(); | ||
let ecosystem_config = EcosystemConfig::from_file(shell)?; | ||
let chain_config = ecosystem_config | ||
.load_chain(chain_name) | ||
.context(MSG_CHAIN_NOT_INITIALIZED)?; | ||
let contracts = chain_config.get_contracts_config()?; | ||
let secrets = chain_config.get_secrets_config()?; | ||
let l1_rpc_url = secrets | ||
.l1 | ||
.context(MSG_L1_SECRETS_MUST_BE_PRESENTED)? | ||
.l1_rpc_url | ||
.expose_str() | ||
.to_string(); | ||
|
||
let spinner = Spinner::new(MSG_ACCEPTING_ADMIN_SPINNER); | ||
accept_admin( | ||
shell, | ||
&ecosystem_config, | ||
contracts.l1.chain_admin_addr, | ||
chain_config.get_wallets_config()?.governor_private_key(), | ||
contracts.l1.diamond_proxy_addr, | ||
&args, | ||
l1_rpc_url.clone(), | ||
) | ||
.await?; | ||
spinner.finish(); | ||
logger::success(MSG_CHAIN_OWNERSHIP_TRANSFERRED); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 2 additions & 56 deletions
58
zk_toolbox/crates/zk_inception/src/commands/chain/common.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.