|
@ -75,12 +75,13 @@ describe('Miscelaneous stuff', function() { |
|
|
if (meta.isPrivkey) { |
|
|
if (meta.isPrivkey) { |
|
|
describe('base58 private key valid ' + b58, function() { |
|
|
describe('base58 private key valid ' + b58, function() { |
|
|
var k; |
|
|
var k; |
|
|
before(function() { |
|
|
var opts = { |
|
|
k = new WalletKey({ |
|
|
|
|
|
network: network |
|
|
network: network |
|
|
|
|
|
}; |
|
|
|
|
|
before(function() { |
|
|
|
|
|
k = new WalletKey(opts); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
it('should generate correctly from WIF', function() { |
|
|
it('parse', function() { |
|
|
|
|
|
k.fromObj({ |
|
|
k.fromObj({ |
|
|
priv: b58 |
|
|
priv: b58 |
|
|
}); |
|
|
}); |
|
@ -95,6 +96,14 @@ describe('Miscelaneous stuff', function() { |
|
|
it('should not be an Address', function() { |
|
|
it('should not be an Address', function() { |
|
|
new Address(b58).isValid().should.equal(false); |
|
|
new Address(b58).isValid().should.equal(false); |
|
|
}); |
|
|
}); |
|
|
|
|
|
it('should generate correctly from hex', function() { |
|
|
|
|
|
var k2 = new WalletKey(opts); |
|
|
|
|
|
k2.fromObj({ |
|
|
|
|
|
priv: hexPayload, |
|
|
|
|
|
compressed: meta.isCompressed |
|
|
|
|
|
}); |
|
|
|
|
|
k2.storeObj().priv.should.equal(b58); |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
describe('base58 address valid ' + b58, function() { |
|
|
describe('base58 address valid ' + b58, function() { |
|
|