Merge pull request #457 from bitcoinjs/clean
tests: simplify crypto fixtures
This commit is contained in:
commit
25e824dd23
2 changed files with 36 additions and 38 deletions
|
@ -5,10 +5,10 @@ var bcrypto = require('../src/crypto')
|
|||
|
||||
var fixtures = require('./fixtures/crypto')
|
||||
|
||||
describe('Crypto', function () {
|
||||
describe('crypto', function () {
|
||||
['hash160', 'hash256', 'ripemd160', 'sha1', 'sha256'].forEach(function (algorithm) {
|
||||
describe(algorithm, function () {
|
||||
fixtures.valid.forEach(function (f) {
|
||||
fixtures.forEach(function (f) {
|
||||
var fn = bcrypto[algorithm]
|
||||
var expected = f[algorithm]
|
||||
|
||||
|
|
6
test/fixtures/crypto.json
vendored
6
test/fixtures/crypto.json
vendored
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"valid": [
|
||||
[
|
||||
{
|
||||
"hex": "0000000000000001",
|
||||
"hash160": "cdb00698f02afd929ffabea308340fa99ac2afa8",
|
||||
|
@ -32,5 +31,4 @@
|
|||
"sha1": "10d96fb43aca84e342206887bbeed3065d4e4344",
|
||||
"sha256": "a7fb8276035057ed6479c5f2305a96da100ac43f0ac10f277e5ab8c5457429da"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue