From 3504ccfa3c893edb39ae4d4a57d1c67e3a5d49fc Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 10 Oct 2016 13:01:51 +1100 Subject: [PATCH] tests: test what was removed in #460 --- test/ecpair.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/ecpair.js b/test/ecpair.js index f9e594a..0e9a3a1 100644 --- a/test/ecpair.js +++ b/test/ecpair.js @@ -148,6 +148,23 @@ describe('ECPair', function () { assert.strictEqual(keyPair.toWIF(), exWIF) }) + it('retains the same defaults as ECPair constructor', function () { + var keyPair = ECPair.makeRandom() + + assert.strictEqual(keyPair.compressed, true) + assert.strictEqual(keyPair.network, NETWORKS.bitcoin) + }) + + it('supports the options parameter', function () { + var keyPair = ECPair.makeRandom({ + compressed: false, + network: NETWORKS.testnet + }) + + assert.strictEqual(keyPair.compressed, false) + assert.strictEqual(keyPair.network, NETWORKS.testnet) + }) + it('loops until d is within interval [1, n - 1]', sinon.test(function () { var rng = this.mock() rng.exactly(3)