Skip to content

Commit

Permalink
renamed password to bip39-passphrase
Browse files Browse the repository at this point in the history
  • Loading branch information
jeefave committed Jun 2, 2021
1 parent 31a55a6 commit 942c127
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/wallet/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class HTTP extends Server {
m: valid.u32('m'),
n: valid.u32('n'),
passphrase: valid.str('passphrase'),
password: valid.str('password'),
'bip39-passphrase': valid.str('bip39-passphrase'),
master: master,
mnemonic: mnemonic,
accountKey: accountKey,
Expand Down
2 changes: 1 addition & 1 deletion lib/wallet/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Wallet extends EventEmitter {
'Must create wallet with hd private key.');
} else {
mnemonic = new Mnemonic(options.mnemonic);
key = HD.fromMnemonic(mnemonic, options.password);
key = HD.fromMnemonic(mnemonic, options['bip39-passphrase']);
}

this.master.fromKey(key, mnemonic);
Expand Down
4 changes: 2 additions & 2 deletions test/wallet-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ describe('Wallet', function() {
assert.bufferEqual(key.getHash(), addr.getHash());
});

it('should yield different keys when password bip39 is supplied', async () => {
it('should yield different keys when bip39-passphrase is supplied', async () => {
const wallet = await wdb.create({
mnemonic: {bits: 256}
});
Expand All @@ -1368,7 +1368,7 @@ describe('Wallet', function() {

const wallet3 = await wdb.create({
mnemonic: wallet.master.mnemonic.toString(),
password: 'test'
'bip39-passphrase': 'test'
});

assert.equal(wallet.master.key.xprivkey(), wallet2.master.key.xprivkey());
Expand Down

0 comments on commit 942c127

Please sign in to comment.