From 5449ad7bff9c52ba7c30ad5a392b80208c1048b5 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Fri, 2 Jan 2015 19:15:20 -0500 Subject: [PATCH] Add test case that incorrectly handles hexa string as json --- test/privatekey.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/privatekey.js b/test/privatekey.js index 7cae44b..3212bd4 100644 --- a/test/privatekey.js +++ b/test/privatekey.js @@ -16,6 +16,7 @@ var invalidbase58 = require('./data/bitcoind/base58_keys_invalid.json'); describe('PrivateKey', function() { var hex = '96c132224121b509b7d0a16245e957d9192609c5637c6228311287b1be21627a'; + var hex2 = '8080808080808080808080808080808080808080808080808080808080808080'; var buf = new Buffer(hex, 'hex'); var wifTestnet = 'cSdkPxkAjA4HDr5VHgsebAPDEh9Gyub4HK8UJr2DFGGqKKy4K5sG'; var wifTestnetUncompressed = '92jJzK4tbURm1C7udQXxeCBvXHoHJstDXRxAMouPG1k1XUaXdsu'; @@ -31,6 +32,12 @@ describe('PrivateKey', function() { 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() { var a = new PrivateKey(Networks.testnet); should.exist(a);