scripts: s/dataOutput/nullDataOutput/
This commit is contained in:
parent
110cb86b5e
commit
62e86e0dc1
3 changed files with 6 additions and 6 deletions
|
@ -112,7 +112,7 @@ function isMultisigOutput(script) {
|
|||
return pubKeys.every(isCanonicalPubKey)
|
||||
}
|
||||
|
||||
function isNulldataOutput(script) {
|
||||
function isNullDataOutput(script) {
|
||||
return script.chunks[0] === ops.OP_RETURN
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ function classifyOutput(script) {
|
|||
return 'multisig'
|
||||
} else if (isPubKeyOutput(script)) {
|
||||
return 'pubkey'
|
||||
} else if (isNulldataOutput(script)) {
|
||||
} else if (isNullDataOutput(script)) {
|
||||
return 'nulldata'
|
||||
}
|
||||
|
||||
|
@ -241,16 +241,16 @@ function multisigInput(signatures, scriptPubKey) {
|
|||
return Script.fromChunks([].concat(ops.OP_0, signatures))
|
||||
}
|
||||
|
||||
function dataOutput(data) {
|
||||
function nullDataOutput(data) {
|
||||
return Script.fromChunks([ops.OP_RETURN, data])
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
classifyInput: classifyInput,
|
||||
classifyOutput: classifyOutput,
|
||||
dataOutput: dataOutput,
|
||||
multisigInput: multisigInput,
|
||||
multisigOutput: multisigOutput,
|
||||
nullDataOutput: nullDataOutput,
|
||||
pubKeyHashInput: pubKeyHashInput,
|
||||
pubKeyHashOutput: pubKeyHashOutput,
|
||||
pubKeyInput: pubKeyInput,
|
||||
|
|
|
@ -78,7 +78,7 @@ describe('bitcoinjs-lib (advanced)', function() {
|
|||
var tx = new bitcoin.TransactionBuilder()
|
||||
|
||||
var data = new Buffer('cafedeadbeef', 'hex')
|
||||
var dataScript = bitcoin.scripts.dataOutput(data)
|
||||
var dataScript = bitcoin.scripts.nullDataOutput(data)
|
||||
|
||||
tx.addInput(unspent.txHash, unspent.index)
|
||||
tx.addOutput(dataScript, 1000)
|
||||
|
|
|
@ -190,7 +190,7 @@ describe('Scripts', function() {
|
|||
if (f.type !== 'nulldata') return
|
||||
|
||||
var data = new Buffer(f.data, 'hex')
|
||||
var scriptPubKey = scripts.dataOutput(data)
|
||||
var scriptPubKey = scripts.nullDataOutput(data)
|
||||
|
||||
describe('output script', function() {
|
||||
it('is generated correctly for ' + f.scriptPubKey, function() {
|
||||
|
|
Loading…
Add table
Reference in a new issue