From 12eb60d2f7e32114b2320cf16e2b6015d1d5b273 Mon Sep 17 00:00:00 2001 From: ricmoo Date: Tue, 9 May 2017 18:53:32 -0400 Subject: [PATCH] Fixed createRandom when no options are passed in. --- wallet/index.js | 2 +- wallet/package.json | 2 +- wallet/wallet.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wallet/index.js b/wallet/index.js index 20a1d3888..4a3c1395d 100644 --- a/wallet/index.js +++ b/wallet/index.js @@ -8,7 +8,7 @@ module.exports = { HDNode: HDNode, Wallet: Wallet, - // Do we need to expose this at all? + SigningKey: SigningKey, _SigningKey: SigningKey, } diff --git a/wallet/package.json b/wallet/package.json index 2953635ef..cbe058787 100644 --- a/wallet/package.json +++ b/wallet/package.json @@ -1,6 +1,6 @@ { "name": "ethers-wallet", - "version": "2.0.0", + "version": "2.0.1", "description": "Wallet and signing library for Ethereum.", "bugs": { "url": "http://github.com/ethers-io/ethers.js/issues", diff --git a/wallet/wallet.js b/wallet/wallet.js index a77efe000..0c2d1cacd 100644 --- a/wallet/wallet.js +++ b/wallet/wallet.js @@ -311,6 +311,9 @@ utils.defineProperty(Wallet, 'isEncryptedWallet', function(json) { utils.defineProperty(Wallet, 'createRandom', function(options) { var entropy = utils.randomBytes(16); + + if (!options) { options = { }; } + if (options.extraEntropy) { entropy = utils.keccak256(utils.concat([entropy, options.extraEntropy])).substring(0, 34); } @@ -393,7 +396,6 @@ utils.defineProperty(Wallet, 'fromBrainWallet', function(username, password, pro }); }); - //utils.defineProperty(Wallet, 'isCrowdsaleWallet', secretStorage.isCrowdsaleWallet); //utils.defineProperty(Wallet, 'decryptCrowdsale', function(json, password) {