Skip to content

Commit 3504ccf

Browse files
committed
tests: test what was removed in bitcoinjs#460
1 parent d27a305 commit 3504ccf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/ecpair.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,23 @@ describe('ECPair', function () {
148148
assert.strictEqual(keyPair.toWIF(), exWIF)
149149
})
150150

151+
it('retains the same defaults as ECPair constructor', function () {
152+
var keyPair = ECPair.makeRandom()
153+
154+
assert.strictEqual(keyPair.compressed, true)
155+
assert.strictEqual(keyPair.network, NETWORKS.bitcoin)
156+
})
157+
158+
it('supports the options parameter', function () {
159+
var keyPair = ECPair.makeRandom({
160+
compressed: false,
161+
network: NETWORKS.testnet
162+
})
163+
164+
assert.strictEqual(keyPair.compressed, false)
165+
assert.strictEqual(keyPair.network, NETWORKS.testnet)
166+
})
167+
151168
it('loops until d is within interval [1, n - 1]', sinon.test(function () {
152169
var rng = this.mock()
153170
rng.exactly(3)

0 commit comments

Comments
 (0)