Browse Source

Add test case that incorrectly handles hexa string as json

patch-2
Braydon Fuller 10 years ago
parent
commit
5449ad7bff
  1. 7
      test/privatekey.js

7
test/privatekey.js

@ -16,6 +16,7 @@ var invalidbase58 = require('./data/bitcoind/base58_keys_invalid.json');
describe('PrivateKey', function() { describe('PrivateKey', function() {
var hex = '96c132224121b509b7d0a16245e957d9192609c5637c6228311287b1be21627a'; var hex = '96c132224121b509b7d0a16245e957d9192609c5637c6228311287b1be21627a';
var hex2 = '8080808080808080808080808080808080808080808080808080808080808080';
var buf = new Buffer(hex, 'hex'); var buf = new Buffer(hex, 'hex');
var wifTestnet = 'cSdkPxkAjA4HDr5VHgsebAPDEh9Gyub4HK8UJr2DFGGqKKy4K5sG'; var wifTestnet = 'cSdkPxkAjA4HDr5VHgsebAPDEh9Gyub4HK8UJr2DFGGqKKy4K5sG';
var wifTestnetUncompressed = '92jJzK4tbURm1C7udQXxeCBvXHoHJstDXRxAMouPG1k1XUaXdsu'; var wifTestnetUncompressed = '92jJzK4tbURm1C7udQXxeCBvXHoHJstDXRxAMouPG1k1XUaXdsu';
@ -31,6 +32,12 @@ describe('PrivateKey', function() {
should.exist(b.bn); should.exist(b.bn);
}); });
it('should create a privatkey from hexa string', function() {
var a = new PrivateKey(hex2);
should.exist(a);
should.exist(a.bn);
});
it('should create a new random testnet private key with only one argument', function() { it('should create a new random testnet private key with only one argument', function() {
var a = new PrivateKey(Networks.testnet); var a = new PrivateKey(Networks.testnet);
should.exist(a); should.exist(a);

Loading…
Cancel
Save