scripts: add dataOutput convenience function
This commit is contained in:
parent
27e69ba716
commit
ea66edeb5c
3 changed files with 22 additions and 1 deletions
test
|
@ -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)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue