Add methods to decode information from output scripts

This commit is contained in:
Thomas Kerin 2016-11-01 16:06:01 +01:00 committed by Daniel Cousens
commit 27b48e8aa2
5 changed files with 252 additions and 82 deletions

View file

@ -36,15 +36,6 @@ describe('address', function () {
})
})
fixtures.valid.forEach(function (f) {
it('parses (as chunks) ' + f.script.slice(0, 30) + '... (' + f.network + ')', function () {
var chunks = bscript.decompile(bscript.fromASM(f.script))
var address = baddress.fromOutputScript(chunks, networks[f.network])
assert.strictEqual(address, f.base58check)
})
})
fixtures.invalid.fromOutputScript.forEach(function (f) {
it('throws when ' + f.script.slice(0, 30) + '... ' + f.exception, function () {
var script = bscript.fromASM(f.script)