fix Wallet default constructor
This commit is contained in:
parent
b2f010428f
commit
a7a7999e3f
2 changed files with 8 additions and 1 deletions
|
@ -34,7 +34,7 @@ var Wallet = function (seed, options) {
|
||||||
this.newMasterKey = function(seed, network) {
|
this.newMasterKey = function(seed, network) {
|
||||||
if (!seed) {
|
if (!seed) {
|
||||||
var seed= new Array(32);
|
var seed= new Array(32);
|
||||||
rng.nextBytes(seedBytes);
|
rng.nextBytes(seed);
|
||||||
}
|
}
|
||||||
masterkey = new HDNode(seed, network);
|
masterkey = new HDNode(seed, network);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,13 @@ describe('Wallet', function() {
|
||||||
assert.equal(account.depth, 2)
|
assert.equal(account.depth, 2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('when seed is not specified', function(){
|
||||||
|
it('generates a seed', function(){
|
||||||
|
var wallet = new Wallet()
|
||||||
|
assert.ok(wallet.getMasterKey())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('constructor options', function() {
|
describe('constructor options', function() {
|
||||||
var wallet;
|
var wallet;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue