Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions e2e/tests-dfx/identity_command.bash
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ XXX
}

@test "identity: consistently imports a known seed phrase" {
echo "hollow damage this yard journey anchor tool fat action school cash ridge oval beef tribe magnet apology cabbage leisure group sign around object exact">seed.txt
echo "display dawn estate night naive stomach receive lock expose boring square boy deposit mistake volume soldier coil rocket match diamond repair opinion action paddle">seed.txt
assert_command dfx identity import alice --seed-file seed.txt --disable-encryption
assert_command dfx identity get-principal --identity alice
assert_eq "zs7ty-uv4vo-rvgkk-srfjo-hjaxr-w55wx-ybo5x-qx7k3-noknf-wzwe5-pqe"
assert_eq "qimd7-lqrvx-kdvsm-7zeqn-bgoix-ukjfi-hgmfg-ur2he-odgb2-joms4-nae"
}
2 changes: 1 addition & 1 deletion src/dfx/src/lib/identity/identity_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ pub(super) fn generate_key() -> DfxResult<(Vec<u8>, Mnemonic)> {
}

pub fn mnemonic_to_key(mnemonic: &Mnemonic) -> DfxResult<SecretKey> {
const DEFAULT_DERIVATION_PATH: &str = "m/44'/60'/0'/0/0";
const DEFAULT_DERIVATION_PATH: &str = "m/44'/223'/0'/0/0";
let seed = Seed::new(mnemonic, "");
let pk = XPrv::derive_from_path(seed.as_bytes(), &DEFAULT_DERIVATION_PATH.parse()?)?;
Ok(SecretKey::from(pk.private_key()))
Expand Down