Skip to content

Commit

Permalink
feat: derive first account with forc-deploy after creating a wallet (F…
Browse files Browse the repository at this point in the history
…uelLabs#4905)

## Description
closes FuelLabs#4861.

This PR derives first account after creating a fresh wallet via
forc-deploy so that we have at least one account available for users to
chose from.

---------

Co-authored-by: Joshua Batty <[email protected]>
  • Loading branch information
kayagokalp and JoshuaBatty authored Aug 17, 2023
1 parent 04a5970 commit d1dbc09
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions forc-plugins/forc-client/src/util/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use fuels_core::types::{
};

use forc_wallet::{
account::derive_secret_key,
account::{derive_secret_key, new_at_index_cli},
balance::{
collect_accounts_with_verification, print_account_balances, AccountBalances,
AccountVerification, AccountsMap,
Expand Down Expand Up @@ -181,7 +181,10 @@ impl<Tx: Buildable + SerializableVec + field::Witnesses + Send> TransactionBuild
let accepted = ask_user_yes_no_question(&question)?;
if accepted {
new_wallet_cli(&wallet_path)?;
println!("Wallet created successfully.")
println!("Wallet created successfully.");
// Derive first account for the fresh wallet we created.
new_at_index_cli(&wallet_path, 0)?;
println!("Account derived successfully.");
} else {
anyhow::bail!("Refused to create a new wallet. If you don't want to use forc-wallet, you can sign this transaction manually with --manual-signing flag.")
}
Expand Down

0 comments on commit d1dbc09

Please sign in to comment.