diff --git a/lib/publickey.js b/lib/publickey.js index 25bc52d..87ce266 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 a5f6514..f35330b 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() {