Skip to content

Commit

Permalink
fix(cli): Fix auth for proposals to staging
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa-tomic committed Apr 3, 2023
1 parent aefe611 commit 937a643
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions rs/cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::cli::version::Commands::{Bless, Retire};
use clap::{CommandFactory, ErrorKind, Parser};
use ic_management_types::requests::NodesRemoveRequest;
use ic_management_types::{MinNakamotoCoefficients, NodeFeature};
use ic_management_types::{MinNakamotoCoefficients, Network, NodeFeature};
use std::collections::BTreeMap;
use std::str::FromStr;

Expand All @@ -15,11 +15,16 @@ mod runner;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
init_logger();
let cli_opts = cli::Opts::parse();
let mut cli_opts = cli::Opts::parse();
let mut cmd = cli::Opts::command();

ic_admin::with_ic_admin(Default::default(), async {
// Start of actually doing stuff with commands.
if cli_opts.network == Network::Staging {
cli_opts.private_key_pem = Some(std::env::var("HOME").expect("Please set HOME env var") + "/.config/dfx/identity/bootstrap-super-leader/identity.pem");
cli_opts.neuron_id = Some(49);
}

match &cli_opts.subcommand {
cli::Commands::DerToPrincipal { path } => {
let principal = ic_base_types::PrincipalId::new_self_authenticating(&std::fs::read(path)?);
Expand Down
2 changes: 1 addition & 1 deletion rs/ic-management-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ impl ReplicaRelease {
}
}

#[derive(Clone)]
#[derive(Clone, PartialEq, Eq)]
pub enum Network {
Staging,
Mainnet,
Expand Down

0 comments on commit 937a643

Please sign in to comment.