tests: remove h2b
This commit is contained in:
parent
ea9c8251a0
commit
002c428019
1 changed files with 4 additions and 8 deletions
|
@ -3,16 +3,13 @@ var base58check = require('../src/base58check')
|
||||||
|
|
||||||
var fixtures = require('./fixtures/base58check.json')
|
var fixtures = require('./fixtures/base58check.json')
|
||||||
|
|
||||||
function h2b(h) { return new Buffer(h, 'hex') }
|
|
||||||
|
|
||||||
describe('base58check', function() {
|
describe('base58check', function() {
|
||||||
describe('decode', function() {
|
describe('decode', function() {
|
||||||
fixtures.valid.forEach(function(f) {
|
fixtures.valid.forEach(function(f) {
|
||||||
it('can decode ' + f.string, function() {
|
it('can decode ' + f.string, function() {
|
||||||
var actual = base58check.decode(f.string)
|
var actual = base58check.decode(f.string).toString('hex')
|
||||||
var expected = h2b(f.payload)
|
|
||||||
|
|
||||||
assert.deepEqual(actual, expected)
|
assert.equal(actual, f.payload)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -28,10 +25,9 @@ describe('base58check', function() {
|
||||||
describe('encode', function() {
|
describe('encode', function() {
|
||||||
fixtures.valid.forEach(function(f) {
|
fixtures.valid.forEach(function(f) {
|
||||||
it('can encode ' + f.string, function() {
|
it('can encode ' + f.string, function() {
|
||||||
var actual = base58check.encode(h2b(f.payload))
|
var actual = base58check.encode(new Buffer(f.payload, 'hex'))
|
||||||
var expected = f.string
|
|
||||||
|
|
||||||
assert.strictEqual(actual, expected)
|
assert.strictEqual(actual, f.string)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue