|
|
@ -29,4 +29,24 @@ describe('PrivateKey', function() { |
|
|
|
|
|
|
|
privkey.as('base58').should.equal('cTpB4YiyKiBcPxnefsDpbnDxFDffjqJob8wGCEDXxgQ7zQoMXJdH'); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should be able to detect network from privatekey', function() { |
|
|
|
var a = new PrivateKey('cMu64LfQqrPC83SjJqde4mZ5jzC48zyeKbUZbTjQdh6pa1h48TdM'); |
|
|
|
a.network().name.should.equal('testnet'); |
|
|
|
var a = new PrivateKey('cS62Ej4SobZnpFQYN1PEEBr2KWf5sgRYYnELtumcG6WVCfxno39V'); |
|
|
|
a.network().name.should.equal('testnet'); |
|
|
|
|
|
|
|
//compress flag = on
|
|
|
|
var a = new PrivateKey('KwHXRTLNWKzxy2NUnnhFtxricC3Dod4Dd3D7RKzVkKDtWrZhuDHs'); |
|
|
|
a.network().name.should.equal('livenet'); |
|
|
|
var a = new PrivateKey('KwaLX8oyJNNCL9tcyYakQHJDTnrPAmZ2M1YK7NhEcT9j55LWqMZz'); |
|
|
|
a.network().name.should.equal('livenet'); |
|
|
|
|
|
|
|
//compress flag = off
|
|
|
|
var a = new PrivateKey('5KS4jw2kT3VoEFUfzgSpX3GVi7qRYkTfwTBU7qxPKyvbGuiVj33'); |
|
|
|
a.network().name.should.equal('livenet'); |
|
|
|
var a = new PrivateKey('5JZsbYcnYN8Dz2YeSLZr6aswrVevedMUSFWxpie6SPpYRb2E4Gi'); |
|
|
|
a.network().name.should.equal('livenet'); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|