scripts: s/dataOutput/nullDataOutput/

This commit is contained in:
Daniel Cousens 2014-11-28 12:52:25 +11:00
parent 110cb86b5e
commit 62e86e0dc1
3 changed files with 6 additions and 6 deletions

View file

@ -112,7 +112,7 @@ function isMultisigOutput(script) {
return pubKeys.every(isCanonicalPubKey) return pubKeys.every(isCanonicalPubKey)
} }
function isNulldataOutput(script) { function isNullDataOutput(script) {
return script.chunks[0] === ops.OP_RETURN return script.chunks[0] === ops.OP_RETURN
} }
@ -127,7 +127,7 @@ function classifyOutput(script) {
return 'multisig' return 'multisig'
} else if (isPubKeyOutput(script)) { } else if (isPubKeyOutput(script)) {
return 'pubkey' return 'pubkey'
} else if (isNulldataOutput(script)) { } else if (isNullDataOutput(script)) {
return 'nulldata' return 'nulldata'
} }
@ -241,16 +241,16 @@ function multisigInput(signatures, scriptPubKey) {
return Script.fromChunks([].concat(ops.OP_0, signatures)) return Script.fromChunks([].concat(ops.OP_0, signatures))
} }
function dataOutput(data) { function nullDataOutput(data) {
return Script.fromChunks([ops.OP_RETURN, data]) return Script.fromChunks([ops.OP_RETURN, data])
} }
module.exports = { module.exports = {
classifyInput: classifyInput, classifyInput: classifyInput,
classifyOutput: classifyOutput, classifyOutput: classifyOutput,
dataOutput: dataOutput,
multisigInput: multisigInput, multisigInput: multisigInput,
multisigOutput: multisigOutput, multisigOutput: multisigOutput,
nullDataOutput: nullDataOutput,
pubKeyHashInput: pubKeyHashInput, pubKeyHashInput: pubKeyHashInput,
pubKeyHashOutput: pubKeyHashOutput, pubKeyHashOutput: pubKeyHashOutput,
pubKeyInput: pubKeyInput, pubKeyInput: pubKeyInput,

View file

@ -78,7 +78,7 @@ describe('bitcoinjs-lib (advanced)', function() {
var tx = new bitcoin.TransactionBuilder() var tx = new bitcoin.TransactionBuilder()
var data = new Buffer('cafedeadbeef', 'hex') 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.addInput(unspent.txHash, unspent.index)
tx.addOutput(dataScript, 1000) tx.addOutput(dataScript, 1000)

View file

@ -190,7 +190,7 @@ describe('Scripts', function() {
if (f.type !== 'nulldata') return if (f.type !== 'nulldata') return
var data = new Buffer(f.data, 'hex') var data = new Buffer(f.data, 'hex')
var scriptPubKey = scripts.dataOutput(data) var scriptPubKey = scripts.nullDataOutput(data)
describe('output script', function() { describe('output script', function() {
it('is generated correctly for ' + f.scriptPubKey, function() { it('is generated correctly for ' + f.scriptPubKey, function() {