From 62e86e0dc116b32482775b2b91f374f31edd96dd Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 28 Nov 2014 12:52:25 +1100 Subject: [PATCH] scripts: s/dataOutput/nullDataOutput/ --- src/scripts.js | 8 ++++---- test/integration/advanced.js | 2 +- test/scripts.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scripts.js b/src/scripts.js index d768ae2..dfd167d 100644 --- a/src/scripts.js +++ b/src/scripts.js @@ -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, diff --git a/test/integration/advanced.js b/test/integration/advanced.js index f4479a5..be6af1f 100644 --- a/test/integration/advanced.js +++ b/test/integration/advanced.js @@ -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) diff --git a/test/scripts.js b/test/scripts.js index 60b4026..6a3c98b 100644 --- a/test/scripts.js +++ b/test/scripts.js @@ -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() {