Skip to content

Commit

Permalink
Update wallet e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karbyshev committed Jan 25, 2024
1 parent f5c9257 commit 6e7d8c2
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions crates/tests/src/e2e/wallet_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use super::setup;
use crate::e2e::setup::Bin;
use crate::run;
use crate::strings::{
WALLET_FOUND_TRANSPARENT_KEYS, WALLET_HD_PASSPHRASE_PROMPT,
WALLET_FOUND_TRANSPARENT_KEYS, WALLET_HD_PASSPHRASE_CONFIRMATION_PROMPT,
WALLET_HD_PASSPHRASE_PROMPT,
};

/// Test wallet key commands with an encrypted key:
Expand All @@ -31,15 +32,21 @@ fn wallet_encrypted_key_cmds() -> Result<()> {
let password = "VeRySeCuR3";

// 1. key gen
let mut cmd =
run!(test, Bin::Wallet, &["gen", "--alias", key_alias], Some(20),)?;
let mut cmd = run!(
test,
Bin::Wallet,
&["gen", "--alias", key_alias, "--bip39-passphrase"],
Some(20),
)?;

cmd.exp_string("Enter your encryption password:")?;
cmd.send_line(password)?;
cmd.exp_string("Enter same passphrase again: ")?;
cmd.send_line(password)?;
cmd.exp_string(WALLET_HD_PASSPHRASE_PROMPT)?;
cmd.send_line("")?;
cmd.send_line("test")?;
cmd.exp_string(WALLET_HD_PASSPHRASE_CONFIRMATION_PROMPT)?;
cmd.send_line("test")?;
cmd.exp_string(&format!(
"Successfully added a key and an address with alias: \"{}\"",
key_alias.to_lowercase()
Expand Down Expand Up @@ -89,9 +96,6 @@ fn wallet_encrypted_key_cmds_env_var() -> Result<()> {
let mut cmd =
run!(test, Bin::Wallet, &["gen", "--alias", key_alias], Some(20),)?;

cmd.exp_string(WALLET_HD_PASSPHRASE_PROMPT)?;
cmd.send_line("")?;

cmd.exp_string(&format!(
"Successfully added a key and an address with alias: \"{}\"",
key_alias.to_lowercase()
Expand Down Expand Up @@ -140,9 +144,6 @@ fn wallet_unencrypted_key_cmds() -> Result<()> {
Some(20),
)?;

cmd.exp_string(WALLET_HD_PASSPHRASE_PROMPT)?;
cmd.send_line("")?;

cmd.exp_string(&format!(
"Successfully added a key and an address with alias: \"{}\"",
key_alias.to_lowercase()
Expand Down

0 comments on commit 6e7d8c2

Please sign in to comment.