|
|
@ -142,7 +142,7 @@ describe('PrivateKey', function() { |
|
|
|
|
|
|
|
it('should create a livenet private key', function() { |
|
|
|
var privkey = new PrivateKey(BN.fromBuffer(buf), 'livenet'); |
|
|
|
privkey.toString().should.equal(wifLivenet); |
|
|
|
privkey.toWIF().should.equal(wifLivenet); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should create a default network private key', function() { |
|
|
@ -204,7 +204,7 @@ describe('PrivateKey', function() { |
|
|
|
|
|
|
|
it('should output this address correctly', function() { |
|
|
|
var privkey = PrivateKey.fromWIF(wifLivenetUncompressed); |
|
|
|
privkey.toString().should.equal(wifLivenetUncompressed); |
|
|
|
privkey.toWIF().should.equal(wifLivenetUncompressed); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
@ -228,20 +228,20 @@ describe('PrivateKey', function() { |
|
|
|
it('should output known livenet address for console', function() { |
|
|
|
var privkey = PrivateKey.fromWIF('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); |
|
|
|
privkey.inspect().should.equal( |
|
|
|
'<PrivateKey: L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m, network: livenet>' |
|
|
|
'<PrivateKey: b9de6e778fe92aa7edb69395556f843f1dce0448350112e14906efc2a80fa61a, network: livenet>' |
|
|
|
); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should output known testnet address for console', function() { |
|
|
|
var privkey = PrivateKey.fromWIF('cR4qogdN9UxLZJXCNFNwDRRZNeLRWuds9TTSuLNweFVjiaE4gPaq'); |
|
|
|
privkey.inspect().should.equal( |
|
|
|
'<PrivateKey: cR4qogdN9UxLZJXCNFNwDRRZNeLRWuds9TTSuLNweFVjiaE4gPaq, network: testnet>' |
|
|
|
'<PrivateKey: 67fd2209ce4a95f6f1d421ab3fbea47ada13df11b73b30c4d9a9f78cc80651ac, network: testnet>' |
|
|
|
); |
|
|
|
}); |
|
|
|
|
|
|
|
it('outputs "uncompressed" for uncompressed imported WIFs', function() { |
|
|
|
var privkey = PrivateKey.fromWIF(wifLivenetUncompressed); |
|
|
|
privkey.inspect().should.equal('<PrivateKey: ' + wifLivenetUncompressed + ', network: livenet, uncompressed>'); |
|
|
|
privkey.inspect().should.equal('<PrivateKey: 96c132224121b509b7d0a16245e957d9192609c5637c6228311287b1be21627a, network: livenet, uncompressed>'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
@ -268,7 +268,7 @@ describe('PrivateKey', function() { |
|
|
|
describe('#toBuffer', function() { |
|
|
|
it('should output known buffer', function() { |
|
|
|
var privkey = new PrivateKey(BN.fromBuffer(buf), 'livenet'); |
|
|
|
privkey.toBuffer().toString('hex').should.equal(buf.toString('hex')); |
|
|
|
privkey.toString().should.equal(buf.toString('hex')); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
@ -323,7 +323,7 @@ describe('PrivateKey', function() { |
|
|
|
|
|
|
|
it('should parse this uncompressed livenet address correctly', function() { |
|
|
|
var privkey = PrivateKey.fromString(wifLivenetUncompressed); |
|
|
|
privkey.toString().should.equal(wifLivenetUncompressed); |
|
|
|
privkey.toString().should.equal("96c132224121b509b7d0a16245e957d9192609c5637c6228311287b1be21627a"); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|