From 77645c7f0301627f353070901db0f8eacf1987b5 Mon Sep 17 00:00:00 2001 From: Gregg Zigler Date: Wed, 24 Jun 2015 14:44:27 -0400 Subject: [PATCH] remove skipped tests since equalivant boolean tests already exist --- lib/script/script.js | 4 ++-- test/script/script.js | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/script/script.js b/lib/script/script.js index f32d768..f93ace2 100644 --- a/lib/script/script.js +++ b/lib/script/script.js @@ -859,11 +859,11 @@ Script.prototype._decodeOP_N = function(opcode) { * @returns {number} number of signature operations required by this script */ Script.prototype.getSignatureOperationsCount = function(accurate) { + accurate = (_.isUndefined(accurate) ? true : accurate); var self = this; - accurate = (typeof accurate == 'undefined') ? true : accurate; var n = 0; var lastOpcode = Opcode.OP_INVALIDOPCODE; - _.each(self.chunks, function getChunkOther(chunk) { + _.each(self.chunks, function getChunk(chunk) { var opcode = chunk.opcodenum; if (opcode == Opcode.OP_CHECKSIG || opcode == Opcode.OP_CHECKSIGVERIFY) { n++; diff --git a/test/script/script.js b/test/script/script.js index 5f5a3c4..d5c3661 100644 --- a/test/script/script.js +++ b/test/script/script.js @@ -794,9 +794,6 @@ describe('Script', function() { Script(s1).getSignatureOperationsCount(true).should.equal(3); Script(s1).getSignatureOperationsCount(false).should.equal(21); }); - it.skip('should handle script arg from p2sh object from string', function() { - // BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig), 3U); - }); it('should handle multi-sig-out scripts from utility function', function() { var sortKeys = pubkey_hexs.slice(0, 3).map(PublicKey); var s2 = Script.buildMultisigOut(sortKeys, 1); @@ -811,9 +808,6 @@ describe('Script', function() { p2sh.getSignatureOperationsCount(true).should.equal(0); p2sh.getSignatureOperationsCount(false).should.equal(0); }); - it.skip('should handle script arg from p2sh object from utility', function() { - // BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig2), 3U); - }); it('should default the one and only argument to true', function() { var s1 = 'OP_1 01 FF OP_2 OP_CHECKMULTISIG'; var trueCount = Script(s1).getSignatureOperationsCount(true);