Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswanson-dfinity committed Jul 21, 2023
1 parent 4dc7af3 commit 980e741
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/dfx/src/commands/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ pub fn exec(env: &dyn Environment, opts: DeployOpts) -> DfxResult {

let using_icp = opts.using_icp_amount;
let with_cycles = opts.with_cycles;
let no_wallet = opts.no_wallet || opts.specified_id.is_some() || opts.using_icp_amount.is_some();
let no_wallet =
opts.no_wallet || opts.specified_id.is_some() || opts.using_icp_amount.is_some();

let deploy_mode = match (mode, canister_name) {
(Some(InstallMode::Reinstall), Some(canister_name)) => {
Expand Down
3 changes: 1 addition & 2 deletions src/dfx/src/commands/ledger/create_canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ use crate::lib::error::DfxResult;
use crate::lib::ledger_types::{Memo, NotifyError};
use crate::lib::nns_types::account_identifier::Subaccount;
use crate::lib::nns_types::icpts::{ICPTs, TRANSACTION_FEE};
use crate::lib::operations::cmc::{MEMO_CREATE_CANISTER, notify_create, transfer_cmc};
use crate::lib::operations::cmc::{notify_create, transfer_cmc, MEMO_CREATE_CANISTER};
use crate::lib::root_key::fetch_root_key_if_needed;
use crate::util::clap::parsers::e8s_parser;

use anyhow::{anyhow, bail, Context};
use candid::Principal;
use clap::Parser;


/// Create a canister from ICP
#[derive(Parser)]
pub struct CreateCanisterOpts {
Expand Down
2 changes: 1 addition & 1 deletion src/dfx/src/commands/quickstart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use num_traits::Inv;
use rust_decimal::Decimal;
use tokio::runtime::Runtime;

use crate::lib::operations::cmc::MEMO_CREATE_CANISTER;
use crate::{
lib::{
agent::create_agent_environment,
Expand All @@ -30,7 +31,6 @@ use crate::{
},
util::assets::wallet_wasm,
};
use crate::lib::operations::cmc::MEMO_CREATE_CANISTER;

/// Use the `dfx quickstart` command to perform initial one time setup for your identity and/or wallet. This command
/// can be run anytime to repeat the setup process or to be used as an informational command, printing
Expand Down
12 changes: 6 additions & 6 deletions src/dfx/src/lib/operations/canister/create_canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use dfx_core::canister::build_wallet_canister;
use dfx_core::identity::CallSender;
use dfx_core::network::provider::get_network_context;

use crate::lib::ledger_types::{Memo, NotifyError};
use crate::lib::nns_types::icpts::{ICPTs, TRANSACTION_FEE};
use crate::lib::operations::cmc::{notify_create, transfer_cmc, MEMO_CREATE_CANISTER};
use anyhow::{anyhow, bail, Context};
use candid::Principal;
use fn_error_context::context;
Expand All @@ -15,8 +17,6 @@ use ic_agent::{Agent, AgentError};
use ic_utils::interfaces::ManagementCanister;
use slog::info;
use std::format;
use crate::lib::ledger_types::{Memo, NotifyError};
use crate::lib::operations::cmc::{MEMO_CREATE_CANISTER, notify_create, transfer_cmc};

// The cycle fee for create request is 0.1T cycles.
const CANISTER_CREATE_FEE: u128 = 100_000_000_000_u128;
Expand Down Expand Up @@ -125,7 +125,7 @@ async fn create_with_ledger(
to_principal,
created_at_time,
)
.await?;
.await?;
println!("Using transfer at block height {height}");

let controller = to_principal;
Expand All @@ -138,9 +138,9 @@ async fn create_with_ledger(
Ok(principal)
}
Err(NotifyError::Refunded {
reason,
block_index,
}) => {
reason,
block_index,
}) => {
match block_index {
Some(height) => {
println!("Refunded at block height {height} with message: {reason}")
Expand Down

0 comments on commit 980e741

Please sign in to comment.