Merge pull request #1041 from bitcoinjs/nulldata
Change nulldata to return Array
This commit is contained in:
commit
402d4f6d6a
5 changed files with 24 additions and 7 deletions
src/templates
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue