Skip to content

Uncaught Error: KeyStore: Invalid mnemonic #182

@DalderupMaurice

Description

@DalderupMaurice

Upgrading from eth-lightwallet 2.5.4 to 3.0.x I am having the issue that I am unable to catch the error whenever a wrong mnemonic is passed to lightwallet.keystore.createVault.

Example:

  lightwallet.keystore.createVault({
    password: password,
    seedPhrase: seed, // Optionally provide a 12-word seed phrase
    hdPathString: "m/44'/60'/0'/0" // Optional custom HD Path String
  }, (err, ks) => {
    // Any code here is NEVER executed when the mnemonic is invalid
    if (err) throw new Error("Wrong password"); // Not triggered on invalid mnemonic
    console.log('test'); // Not triggered on invalid mnemonic
  });

In this example, whenever the password is wrong, the callback does not retrieve an error keystore. It just displays an uncaught error in the console of the browser. I also tried placing a try - catch around it, but it still does not work.

This is the error shown in the browser:

Uncaught Error: KeyStore: Invalid mnemonic
    at KeyStore.init (keystore.js:75)
    at keystore.js:114
    at cb (keystore.js:352)
    at scrypt-async.js:518
    at scrypt-async.js:481
    at run (setImmediate.js:40)
    at runIfPresent (setImmediate.js:69)
    at onGlobalMessage (setImmediate.js:109)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions