diff --git a/src/dfx/src/commands/canister/delete.rs b/src/dfx/src/commands/canister/delete.rs index 4351284b89..cb29aff404 100644 --- a/src/dfx/src/commands/canister/delete.rs +++ b/src/dfx/src/commands/canister/delete.rs @@ -27,7 +27,6 @@ use num_traits::cast::ToPrimitive; use slog::info; use std::convert::TryFrom; -#[allow(deprecated)] const DANK_PRINCIPAL: Principal = Principal::from_slice(&[0, 0, 0, 0, 0, 0xe0, 1, 0x11, 0x01, 0x01]); // Principal: aanaa-xaaaa-aaaah-aaeiq-cai diff --git a/src/dfx/src/commands/wallet/redeem_faucet_coupon.rs b/src/dfx/src/commands/wallet/redeem_faucet_coupon.rs index 93568c4f0c..3ba18bcfda 100644 --- a/src/dfx/src/commands/wallet/redeem_faucet_coupon.rs +++ b/src/dfx/src/commands/wallet/redeem_faucet_coupon.rs @@ -10,7 +10,8 @@ use candid::{encode_args, Decode, Principal}; use clap::Parser; use slog::{info, warn}; -const DEFAULT_FAUCET_PRINCIPAL: &str = "fg7gi-vyaaa-aaaal-qadca-cai"; +pub const DEFAULT_FAUCET_PRINCIPAL: Principal = + Principal::from_slice(&[0, 0, 0, 0, 1, 112, 0, 196, 1, 1]); /// Redeem a code at the cycles faucet. #[derive(Parser)] @@ -31,7 +32,7 @@ pub async fn exec(env: &dyn Environment, opts: RedeemFaucetCouponOpts) -> DfxRes Principal::from_text(&alternative_faucet) .or_else(|_| canister_id_store.get(&alternative_faucet))? } else { - Principal::from_text(DEFAULT_FAUCET_PRINCIPAL).unwrap() + DEFAULT_FAUCET_PRINCIPAL }; let agent = env.get_agent(); if fetch_root_key_if_needed(env).await.is_err() { @@ -101,3 +102,16 @@ pub async fn exec(env: &dyn Environment, opts: RedeemFaucetCouponOpts) -> DfxRes } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_faucet_canister_id() { + assert_eq!( + DEFAULT_FAUCET_PRINCIPAL, + Principal::from_text("fg7gi-vyaaa-aaaal-qadca-cai").unwrap() + ); + } +} diff --git a/src/dfx/src/lib/ledger_types/mod.rs b/src/dfx/src/lib/ledger_types/mod.rs index a02fda3210..c274a5f1b1 100644 --- a/src/dfx/src/lib/ledger_types/mod.rs +++ b/src/dfx/src/lib/ledger_types/mod.rs @@ -10,11 +10,9 @@ use serde::{Deserialize, Serialize}; use std::fmt; /// Id of the ledger canister on the IC. -#[allow(deprecated)] pub const MAINNET_LEDGER_CANISTER_ID: Principal = Principal::from_slice(&[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x01]); -#[allow(deprecated)] pub const MAINNET_CYCLE_MINTER_CANISTER_ID: Principal = Principal::from_slice(&[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01]);