Base58check: no longer encodes version separately

This commit is contained in:
Daniel Cousens 2014-06-03 17:02:59 +10:00
parent 63e6cf987f
commit d39662e375
6 changed files with 88 additions and 317 deletions

View file

@ -10,20 +10,16 @@ describe('base58check', function() {
fixtures.valid.forEach(function(f) {
it('can decode ' + f.string, function() {
var actual = base58check.decode(f.string)
var expected = {
version: f.decode.version || 0,
payload: h2b(f.decode.payload),
checksum: h2b(f.decode.checksum)
}
var expected = h2b(f.payload)
assert.deepEqual(actual, expected)
})
})
fixtures.invalid.forEach(function(f) {
it('throws on ' + f.description, function() {
it('throws on ' + f, function() {
assert.throws(function() {
base58check.decode(f.string)
base58check.decode(f)
}, /Invalid checksum/)
})
})
@ -32,7 +28,7 @@ describe('base58check', function() {
describe('encode', function() {
fixtures.valid.forEach(function(f) {
it('can encode ' + f.string, function() {
var actual = base58check.encode(h2b(f.decode.payload), f.decode.version)
var actual = base58check.encode(h2b(f.payload))
var expected = f.string
assert.strictEqual(actual, expected)