Skip to content

Commit

Permalink
clippy, fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswanson-dfinity committed Oct 4, 2023
1 parent f6537c0 commit 1507244
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 25 deletions.
4 changes: 1 addition & 3 deletions src/dfx/src/commands/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ use crate::lib::nns_types::icpts::ICPTs;
use crate::lib::operations::canister::DeployMode::{
ComputeEvidence, ForceReinstallSingleCanister, NormalDeploy, PrepareForProposal,
};
use crate::lib::operations::canister::{
deploy_canisters, Funding, ICPFunding, ICPFundingRetry, ICPFundingRetryPhase,
};
use crate::lib::operations::canister::{deploy_canisters, Funding, ICPFunding};
use crate::lib::root_key::fetch_root_key_if_needed;
use crate::lib::{environment::Environment, named_canister};
use crate::util::clap::parsers::cycle_amount_parser;
Expand Down
12 changes: 5 additions & 7 deletions src/dfx/src/lib/operations/canister/create_canister.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
use crate::lib::diagnosis::DiagnosedError;
use crate::lib::environment::Environment;
use crate::lib::error::DfxResult;
use crate::lib::error::NotifyCreateCanisterError::Notify;
use crate::lib::ic_attributes::CanisterSettings;
use crate::lib::ledger_types::{Memo, NotifyError};
use crate::lib::nns_types::icpts::{ICPTs, TRANSACTION_FEE};
use crate::lib::operations::canister::deploy_canisters::{
ICPFunding, ICPFundingRetry, ICPFundingRetryPhase,
};
use crate::lib::ledger_types::Memo;
use crate::lib::nns_types::icpts::TRANSACTION_FEE;
use crate::lib::operations::canister::deploy_canisters::ICPFunding;
use crate::lib::operations::canister::motoko_playground::reserve_canister_with_playground;
use crate::lib::operations::canister::Funding;
use crate::lib::operations::cmc::{notify_create, transfer_cmc, MEMO_CREATE_CANISTER};
Expand Down Expand Up @@ -120,7 +117,8 @@ async fn create_with_ledger(
) -> DfxResult<Principal> {
let to_principal = agent.get_principal().unwrap();

let canister_name_matches = matches!(&funding.retry_canister_name, Some(canister_name));
let canister_name_matches =
matches!(&funding.retry_canister_name, Some(name) if name == canister_name);

let retry_block_height = funding
.retry_notify_block_height
Expand Down
12 changes: 0 additions & 12 deletions src/dfx/src/lib/operations/canister/deploy_canisters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ pub enum DeployMode {
ComputeEvidence(String),
}

#[derive(Eq, PartialEq, Debug, Clone)]
pub enum ICPFundingRetryPhase {
Transfer(u64),
Notify(BlockHeight),
}

#[derive(Eq, PartialEq, Debug, Clone)]
pub struct ICPFundingRetry {
pub canister_name: String,
pub phase: ICPFundingRetryPhase,
}

#[derive(Eq, PartialEq, Debug, Clone)]
pub struct ICPFunding {
pub amount: ICPTs,
Expand Down
4 changes: 1 addition & 3 deletions src/dfx/src/lib/operations/canister/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ use candid::CandidType;
use candid::Principal as CanisterId;
use candid::Principal;
pub use deploy_canisters::deploy_canisters;
pub use deploy_canisters::{
DeployMode, Funding, ICPFunding, ICPFundingRetry, ICPFundingRetryPhase,
};
pub use deploy_canisters::{DeployMode, Funding, ICPFunding};
use dfx_core::canister::build_wallet_canister;
pub use dfx_core::canister::install_canister_wasm;
use dfx_core::identity::CallSender;
Expand Down

0 comments on commit 1507244

Please sign in to comment.