diff --git a/lib/script/script.js b/lib/script/script.js index 9eff54bf..47657aa7 100644 --- a/lib/script/script.js +++ b/lib/script/script.js @@ -1405,7 +1405,7 @@ Script.prototype.fromPubkey = function fromPubkey(key) { key = this.raw.slice(1, 1 + key.length); this.code.push(new Opcode(key.length, key)); - this.code.push(new Opcode(opcodes.OP_CHECKSIG)); + this.code.push(Opcode.fromOp(opcodes.OP_CHECKSIG)); return this; }; @@ -1439,11 +1439,11 @@ Script.prototype.fromPubkeyhash = function fromPubkeyhash(hash) { hash = this.raw.slice(3, 23); - this.code.push(new Opcode(opcodes.OP_DUP)); - this.code.push(new Opcode(opcodes.OP_HASH160)); + this.code.push(Opcode.fromOp(opcodes.OP_DUP)); + this.code.push(Opcode.fromOp(opcodes.OP_HASH160)); this.code.push(new Opcode(0x14, hash)); - this.code.push(new Opcode(opcodes.OP_EQUALVERIFY)); - this.code.push(new Opcode(opcodes.OP_CHECKSIG)); + this.code.push(Opcode.fromOp(opcodes.OP_EQUALVERIFY)); + this.code.push(Opcode.fromOp(opcodes.OP_CHECKSIG)); return this; }; @@ -1517,9 +1517,9 @@ Script.prototype.fromScripthash = function fromScripthash(hash) { hash = this.raw.slice(2, 22); - this.code.push(new Opcode(opcodes.OP_HASH160)); + this.code.push(Opcode.fromOp(opcodes.OP_HASH160)); this.code.push(new Opcode(0x14, hash)); - this.code.push(new Opcode(opcodes.OP_EQUAL)); + this.code.push(Opcode.fromOp(opcodes.OP_EQUAL)); return this; };