From fcc3a1c9619e21e3a93ec57d2696ac7e46700947 Mon Sep 17 00:00:00 2001 From: Esteban Ordano Date: Mon, 15 Dec 2014 18:58:41 -0300 Subject: [PATCH] Add tests for importing from WIF --- test/privatekey.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/privatekey.js b/test/privatekey.js index 508c57d..e0dd4bd 100644 --- a/test/privatekey.js +++ b/test/privatekey.js @@ -303,4 +303,14 @@ describe('PrivateKey', function() { }); + it('creates an address as expected from WIF, livenet', function() { + var privkey = new PrivateKey('5J2NYGstJg7aJQEqNwYp4enG5BSfFdKXVTtBLvHicnRGD5kjxi6') + privkey.publicKey.toAddress().toString().should.equal('135bwugFCmhmNU3SeCsJeTqvo5ViymgwZ9'); + }); + + it('creates an address as expected from WIF, testnet', function() { + var privkey = new PrivateKey('92VYMmwFLXRwXn5688edGxYYgMFsc3fUXYhGp17WocQhU6zG1kd') + privkey.publicKey.toAddress().toString().should.equal('moiAvLUw16qgrwhFGo1eDnXHC2wPMYiv7Y'); + }); + });