From e3fa89ce629527f51d5159f7a68093809922f77f Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 16 Dec 2014 12:25:01 -0500 Subject: [PATCH] PublicKey: Fix formatting issue for inspect --- lib/publickey.js | 2 +- test/publickey.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/publickey.js b/lib/publickey.js index 25bc52d01..87ce26644 100644 --- a/lib/publickey.js +++ b/lib/publickey.js @@ -403,7 +403,7 @@ PublicKey.prototype.toString = function() { PublicKey.prototype.inspect = function() { return ''; + (this.network ? ', network: ' + this.network.name : '') + '>'; }; diff --git a/test/publickey.js b/test/publickey.js index a5f6514de..f35330b4a 100644 --- a/test/publickey.js +++ b/test/publickey.js @@ -300,6 +300,12 @@ describe('PublicKey', function() { pubkey.inspect().should.equal(''); }); + it('should output known compressed pubkey with network for console', function() { + var privkey = PrivateKey.fromWIF('L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m'); + var pubkey = new PublicKey(privkey); + pubkey.inspect().should.equal(''); + }); + }); describe('#validate', function() {