Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: forc-deploy asks for password before checking if the wallet exists #6704

Merged
merged 2 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions forc-plugins/forc-client/src/op/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::{
pkg::{built_pkgs, create_proxy_contract, update_proxy_address_in_manifest},
target::Target,
tx::{
prompt_forc_wallet_password, select_account, update_proxy_contract_target,
SignerSelectionMode,
check_and_create_wallet_at_default_path, prompt_forc_wallet_password, select_account,
update_proxy_contract_target, SignerSelectionMode,
},
},
};
Expand Down Expand Up @@ -1002,6 +1002,11 @@ async fn setup_deployment_account(
} else if let Some(arn) = &command.aws_kms_signer {
SignerSelectionMode::AwsSigner(arn.clone())
} else {
// Check if we have a wallet in the default path
// If there is one we will ask for the password
// If not we will ask the user to either create a new one or import one
let wallet_path = default_wallet_path();
check_and_create_wallet_at_default_path(&wallet_path)?;
println_action_green("", &format!("Wallet: {}", default_wallet_path().display()));
let password = prompt_forc_wallet_password()?;
SignerSelectionMode::ForcWallet(password)
Expand Down
3 changes: 0 additions & 3 deletions forc-plugins/forc-client/src/util/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ pub(crate) async fn select_account(
match wallet_mode {
SignerSelectionMode::ForcWallet(password) => {
let wallet_path = default_wallet_path();
check_and_create_wallet_at_default_path(&wallet_path)?;
// TODO: This is a very simple TUI, we should consider adding a nice TUI
// capabilities for selections and answer collection.
let accounts = collect_user_accounts(&wallet_path, password)?;
let account_balances = collect_account_balances(&accounts, provider).await?;
let base_asset_id = provider.base_asset_id();
Expand Down
Loading