Browse Source

Merge pull request #1214 from bitcoinjs/hoodwink

use Hoodwink 2
v4
Jonathan Underwood 7 years ago
committed by GitHub
parent
commit
d082c9b41c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      package.json
  2. 10
      test/ecpair.js
  3. 2
      test/transaction_builder.js

2
package.json

@ -53,7 +53,7 @@
"bn.js": "^4.11.8", "bn.js": "^4.11.8",
"bs58": "^4.0.0", "bs58": "^4.0.0",
"dhttp": "^2.5.0", "dhttp": "^2.5.0",
"hoodwink": "^1.0.0", "hoodwink": "^2.0.0",
"minimaldata": "^1.0.2", "minimaldata": "^1.0.2",
"mocha": "^5.2.0", "mocha": "^5.2.0",
"nyc": "^11.8.0", "nyc": "^11.8.0",

10
test/ecpair.js

@ -187,8 +187,8 @@ describe('ECPair', function () {
}) })
it('loops until d is within interval [1, n) : 1', hoodwink(function () { it('loops until d is within interval [1, n) : 1', hoodwink(function () {
const rng = this.stub(function f () { const rng = this.stub(function () {
if (f.calls === 0) return ZERO // 0 if (rng.calls === 0) return ZERO // 0
return ONE // >0 return ONE // >0
}, 2) }, 2)
@ -196,9 +196,9 @@ describe('ECPair', function () {
})) }))
it('loops until d is within interval [1, n) : n - 1', hoodwink(function () { it('loops until d is within interval [1, n) : n - 1', hoodwink(function () {
const rng = this.stub(function f () { const rng = this.stub(function () {
if (f.calls === 0) return ZERO // <1 if (rng.calls === 0) return ZERO // <1
if (f.calls === 1) return GROUP_ORDER // >n-1 if (rng.calls === 1) return GROUP_ORDER // >n-1
return GROUP_ORDER_LESS_1 // n-1 return GROUP_ORDER_LESS_1 // n-1
}, 3) }, 3)

2
test/transaction_builder.js

@ -4,8 +4,6 @@ const assert = require('assert')
const baddress = require('../src/address') const baddress = require('../src/address')
const bcrypto = require('../src/crypto') const bcrypto = require('../src/crypto')
const bscript = require('../src/script') const bscript = require('../src/script')
const ops = require('bitcoin-ops')
const payments = require('../src/payments')
const ECPair = require('../src/ecpair') const ECPair = require('../src/ecpair')
const Transaction = require('../src/transaction') const Transaction = require('../src/transaction')

Loading…
Cancel
Save