Merge pull request from bitcoinjs/nulldata

Change nulldata to return Array
This commit is contained in:
Daniel Cousens 2018-05-15 02:24:58 +10:00 committed by GitHub
commit 402d4f6d6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 7 deletions
src/templates

View file

@ -14,15 +14,15 @@ function check (script) {
check.toJSON = function () { return 'null data output' }
function encode (data) {
typeforce(types.Buffer, data)
typeforce([types.Buffer], data)
return bscript.compile([OPS.OP_RETURN, data])
return bscript.compile([OPS.OP_RETURN].concat(data))
}
function decode (buffer) {
typeforce(check, buffer)
return buffer.slice(2)
return bscript.decompile(buffer).slice(1)
}
module.exports = {