Browse Source

script: adhere to latest standard precedence rules

hk-custom-address
Daniel Cousens 8 years ago
committed by Daniel Cousens
parent
commit
846da39346
  1. 2
      package.json
  2. 6
      src/script.js

2
package.json

@ -75,7 +75,7 @@
"nyc": "^8.1.0",
"proxyquire": "^1.4.0",
"sinon": "^1.12.2",
"standard": "^8.0.0"
"standard": "^9.0.2"
},
"license": "MIT"
}

6
src/script.js

@ -10,9 +10,9 @@ var OP_INT_BASE = OPS.OP_RESERVED // OP_1 - 1
function isOPInt (value) {
return types.Number(value) &&
(value === OPS.OP_0) ||
((value === OPS.OP_0) ||
(value >= OPS.OP_1 && value <= OPS.OP_16) ||
(value === OPS.OP_1NEGATE)
(value === OPS.OP_1NEGATE))
}
function isPushOnlyChunk (value) {
@ -33,7 +33,7 @@ function compile (chunks) {
// data chunk
if (Buffer.isBuffer(chunk)) {
// adhere to BIP62.3, minimal push policy
if (chunk.length === 1 && (chunk[0] === 0x81 || chunk[0] >= 1 && chunk[0] <= 16)) {
if (chunk.length === 1 && (chunk[0] === 0x81 || (chunk[0] >= 1 && chunk[0] <= 16))) {
return accum + 1
}

Loading…
Cancel
Save