tests: remove h2b

This commit is contained in:
Daniel Cousens 2014-06-26 18:44:42 +10:00
parent ea9c8251a0
commit 002c428019

View file

@ -3,16 +3,13 @@ var base58check = require('../src/base58check')
var fixtures = require('./fixtures/base58check.json')
function h2b(h) { return new Buffer(h, 'hex') }
describe('base58check', function() {
describe('decode', function() {
fixtures.valid.forEach(function(f) {
it('can decode ' + f.string, function() {
var actual = base58check.decode(f.string)
var expected = h2b(f.payload)
var actual = base58check.decode(f.string).toString('hex')
assert.deepEqual(actual, expected)
assert.equal(actual, f.payload)
})
})
@ -28,10 +25,9 @@ describe('base58check', function() {
describe('encode', function() {
fixtures.valid.forEach(function(f) {
it('can encode ' + f.string, function() {
var actual = base58check.encode(h2b(f.payload))
var expected = f.string
var actual = base58check.encode(new Buffer(f.payload, 'hex'))
assert.strictEqual(actual, expected)
assert.strictEqual(actual, f.string)
})
})
})