Fixed createRandom when no options are passed in.

This commit is contained in:
ricmoo 2017-05-09 18:53:32 -04:00
parent 00b628c6cc
commit 12eb60d2f7
3 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@ module.exports = {
HDNode: HDNode,
Wallet: Wallet,
// Do we need to expose this at all?
SigningKey: SigningKey,
_SigningKey: SigningKey,
}

View File

@ -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",

View File

@ -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) {