address/base58check: fix missing exceptions/tests
All the `invalid2` tests have been removed as they were not invalid base58check. They were actually valid in some cases. They will be re-integrated in more specific bitcoin core tests in relation to Address/ECKey respectively.
This commit is contained in:
parent
47ae862ae9
commit
2fc69b0834
5 changed files with 28 additions and 88 deletions
test
|
@ -3,11 +3,8 @@ var Address = require('../src/address')
|
|||
var networks = require('../src/networks')
|
||||
var Script = require('../src/script')
|
||||
|
||||
var b58fixtures = require('./fixtures/base58.json')
|
||||
var fixtures = require('./fixtures/address.json')
|
||||
|
||||
function h2b(h) { return new Buffer(h, 'hex') }
|
||||
|
||||
describe('Address', function() {
|
||||
describe('Constructor', function() {
|
||||
it('does not mutate the input', function() {
|
||||
|
@ -31,11 +28,11 @@ describe('Address', function() {
|
|||
})
|
||||
})
|
||||
|
||||
it('throws on invalid base58check', function() {
|
||||
b58fixtures.invalid.forEach(function(f) {
|
||||
fixtures.invalid.fromBase58Check.forEach(function(f) {
|
||||
it('throws on ' + f.descpription, function() {
|
||||
assert.throws(function() {
|
||||
Address.fromBase58Check(f)
|
||||
})
|
||||
Address.fromBase58Check(f.base58check)
|
||||
}, new RegExp(f.exception))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue