Kyle Drake
11 years ago
No known key found for this signature in database
GPG Key ID: 8BE721072E1864BE
1 changed files with
144 additions and
151 deletions
-
src/opcode.js
|
|
@ -1,12 +1,5 @@ |
|
|
|
var Opcode = function (num) { |
|
|
|
this.code = num; |
|
|
|
}; |
|
|
|
|
|
|
|
Opcode.prototype.toString = function () { |
|
|
|
return Opcode.reverseMap[this.code]; |
|
|
|
}; |
|
|
|
|
|
|
|
Opcode.map = { |
|
|
|
Opcode = { |
|
|
|
map: { |
|
|
|
// push value
|
|
|
|
OP_0 : 0, |
|
|
|
OP_FALSE : 0, |
|
|
@ -143,12 +136,12 @@ Opcode.map = { |
|
|
|
OP_PUBKEYHASH : 253, |
|
|
|
OP_PUBKEY : 254, |
|
|
|
OP_INVALIDOPCODE : 255 |
|
|
|
}; |
|
|
|
|
|
|
|
Opcode.reverseMap = []; |
|
|
|
}, |
|
|
|
reverseMap: [] |
|
|
|
} |
|
|
|
|
|
|
|
for(var i in Opcode.map) { |
|
|
|
Opcode.reverseMap[Opcode.map[i]] = i; |
|
|
|
Opcode.reverseMap[Opcode.map[i]] = i |
|
|
|
} |
|
|
|
|
|
|
|
module.exports = Opcode; |
|
|
|
module.exports = Opcode |
|
|
|