scripts: add dataOutput convenience function

This commit is contained in:
Daniel Cousens 2014-10-19 12:29:40 +11:00
parent 27e69ba716
commit ea66edeb5c
3 changed files with 22 additions and 1 deletions

View file

@ -184,4 +184,19 @@ describe('Scripts', function() {
})
})
})
describe('data', function() {
fixtures.valid.forEach(function(f) {
if (f.type !== 'nulldata') return
var data = new Buffer(f.data, 'hex')
var scriptPubKey = scripts.dataOutput(data)
describe('output script', function() {
it('is generated correctly for ' + f.scriptPubKey, function() {
assert.equal(scriptPubKey.toASM(), f.scriptPubKey)
})
})
})
})
})