vm: add generic stub for all unimplemented instructions

This commit is contained in:
Roman Khimov 2019-09-05 17:32:34 +03:00
parent 59de72f446
commit 3f40334979

View file

@ -577,10 +577,6 @@ func (v *VM) execute(ctx *Context, op Instruction) {
panic("APPEND: not of underlying type Array") panic("APPEND: not of underlying type Array")
} }
case REVERSE:
case REMOVE:
case PACK: case PACK:
n := int(v.estack.Pop().BigInt().Int64()) n := int(v.estack.Pop().BigInt().Int64())
if n < 0 || n > v.estack.Len() { if n < 0 || n > v.estack.Len() {
@ -594,9 +590,6 @@ func (v *VM) execute(ctx *Context, op Instruction) {
v.estack.PushVal(items) v.estack.PushVal(items)
case UNPACK:
panic("TODO")
case PICKITEM: case PICKITEM:
var ( var (
key = v.estack.Pop() key = v.estack.Pop()
@ -719,6 +712,10 @@ func (v *VM) execute(ctx *Context, op Instruction) {
v.state = haltState v.state = haltState
} }
case CAT, SUBSTR, LEFT, RIGHT, CHECKSIG, CHECKMULTISIG,
UNPACK, REVERSE, REMOVE:
panic("unimplemented")
// Cryptographic operations. // Cryptographic operations.
case SHA1: case SHA1:
b := v.estack.Pop().Bytes() b := v.estack.Pop().Bytes()
@ -738,12 +735,6 @@ func (v *VM) execute(ctx *Context, op Instruction) {
b := v.estack.Pop().Bytes() b := v.estack.Pop().Bytes()
v.estack.PushVal(hash.DoubleSha256(b).Bytes()) v.estack.PushVal(hash.DoubleSha256(b).Bytes())
case CHECKSIG:
// pubkey := v.estack.Pop().Bytes()
// sig := v.estack.Pop().Bytes()
case CHECKMULTISIG:
case NOP: case NOP:
// unlucky ^^ // unlucky ^^