diff --git a/.travis.yml b/.travis.yml index 26f05da..7422a8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ language: node_js before_install: - "npm install npm -g" node_js: - - "0.11" - - "0.10" + - "0.12" env: - TEST_SUITE=coveralls - TEST_SUITE=integration diff --git a/src/bufferutils.js b/src/bufferutils.js index 773e502..9f1c85e 100644 --- a/src/bufferutils.js +++ b/src/bufferutils.js @@ -168,16 +168,6 @@ function varIntBuffer (i) { return buffer } -function equal (a, b) { - if (a.length !== b.length) return false - - for (var i = 0; i < a.length; ++i) { - if (a[i] !== b[i]) return false - } - - return true -} - function reverse (buffer) { var buffer2 = new Buffer(buffer) Array.prototype.reverse.call(buffer2) @@ -185,7 +175,6 @@ function reverse (buffer) { } module.exports = { - equal: equal, pushDataSize: pushDataSize, readPushDataInt: readPushDataInt, readUInt64LE: readUInt64LE, diff --git a/src/transaction_builder.js b/src/transaction_builder.js index a08af72..cafcfc8 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -1,5 +1,4 @@ var assert = require('assert') -var bufferutils = require('./bufferutils') var ops = require('./opcodes') var scripts = require('./scripts') @@ -400,7 +399,7 @@ TransactionBuilder.prototype.sign = function (index, keyPair, redeemScript, hash // enforce in order signing of public keys assert(input.pubKeys.some(function (pubKey, i) { - if (!bufferutils.equal(kpPubKey, pubKey)) return false + if (kpPubKey.compare(pubKey) !== 0) return false assert(!input.signatures[i], 'Signature already exists') @@ -408,7 +407,7 @@ TransactionBuilder.prototype.sign = function (index, keyPair, redeemScript, hash input.signatures[i] = signature return true - }, this), 'key pair cannot sign for this input') + }), 'key pair cannot sign for this input') } module.exports = TransactionBuilder diff --git a/test/bufferutils.js b/test/bufferutils.js index c97e0bc..eaef22a 100644 --- a/test/bufferutils.js +++ b/test/bufferutils.js @@ -88,22 +88,6 @@ describe('bufferutils', function () { }) }) - describe('equal', function () { - fixtures.valid.forEach(function (f) { - describe('for ' + f.hexVI, function () { - fixtures.valid.forEach(function (f2) { - it('equates the string comparison: ' + f.hexVI + ' === ' + f2.hexVI, function () { - var a = new Buffer(f.hexVI, 'hex') - var b = new Buffer(f2.hexVI, 'hex') - var expected = f.hexVI === f2.hexVI - - assert.equal(bufferutils.equal(a, b), expected) - }) - }) - }) - }) - }) - describe('reverse', function () { fixtures.valid.forEach(function (f) { it('reverses ' + f.hex64 + ' correctly', function () {