script: stop using new Opcode.

This commit is contained in:
Christopher Jeffrey 2017-08-19 23:14:18 -07:00
parent 040e798d9f
commit 5047028511
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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;
};