Skip to content

Commit

Permalink
Merge pull request #8 from ajp8164/master
Browse files Browse the repository at this point in the history
Rename cleanup
  • Loading branch information
Andy Phillipson committed Sep 29, 2017
2 parents 8566192 + bcae6ff commit 8d25e9b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/mnemonic.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
'use strict';

var btc = require('btc-lib');
var BN = btc.crypto.BN;
var btcLib = require('btc-lib');
var BN = btcLib.crypto.BN;
var unorm = require('unorm');
var _ = btc.deps._;
var _ = btcLib.deps._;

var pbkdf2 = require('./pbkdf2');
var errors = require('./errors');

var Hash = btc.crypto.Hash;
var Random = btc.crypto.Random;
var Hash = btcLib.crypto.Hash;
var Random = btcLib.crypto.Random;

var $ = btc.util.preconditions;
var $ = btcLib.util.preconditions;


/**
Expand Down Expand Up @@ -55,7 +55,7 @@ var Mnemonic = function(data, wordlist) {
} else if (_.isNumber(data)) {
ent = data;
} else if (data) {
throw new btc.errors.InvalidArgument('data', 'Must be a Buffer, a string or an integer');
throw new btcLib.errors.InvalidArgument('data', 'Must be a Buffer, a string or an integer');
}
ent = ent || 128;

Expand All @@ -77,7 +77,7 @@ var Mnemonic = function(data, wordlist) {
throw new errors.InvalidMnemonic(phrase);
}
if (ent % 32 !== 0 || ent < 128) {
throw new btc.errors.InvalidArgument('ENT', 'Values must be ENT > 128 and ENT % 32 == 0');
throw new btcLib.errors.InvalidArgument('ENT', 'Values must be ENT > 128 and ENT % 32 == 0');
}

phrase = phrase || Mnemonic._mnemonic(ent, wordlist);
Expand Down Expand Up @@ -204,7 +204,7 @@ Mnemonic.fromSeed = function(seed, wordlist) {
*/
Mnemonic.prototype.toHDPrivateKey = function(passphrase, network) {
var seed = this.toSeed(passphrase);
return btc.HDPrivateKey.fromSeed(seed, network);
return btcLib.HDPrivateKey.fromSeed(seed, network);
};

/**
Expand Down Expand Up @@ -292,6 +292,6 @@ Mnemonic._entropyChecksum = function(entropy) {
return checksum;
};

Mnemonic.btc = btc;
Mnemonic.btcLib = btcLib;

module.exports = Mnemonic;

0 comments on commit 8d25e9b

Please sign in to comment.