From 3f403349799bda1f545b7e4aa475138734776d01 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 5 Sep 2019 17:32:34 +0300 Subject: [PATCH] vm: add generic stub for all unimplemented instructions --- pkg/vm/vm.go | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pkg/vm/vm.go b/pkg/vm/vm.go index e5eeb15d8..422e8e9e6 100644 --- a/pkg/vm/vm.go +++ b/pkg/vm/vm.go @@ -577,10 +577,6 @@ func (v *VM) execute(ctx *Context, op Instruction) { panic("APPEND: not of underlying type Array") } - case REVERSE: - - case REMOVE: - case PACK: n := int(v.estack.Pop().BigInt().Int64()) if n < 0 || n > v.estack.Len() { @@ -594,9 +590,6 @@ func (v *VM) execute(ctx *Context, op Instruction) { v.estack.PushVal(items) - case UNPACK: - panic("TODO") - case PICKITEM: var ( key = v.estack.Pop() @@ -719,6 +712,10 @@ func (v *VM) execute(ctx *Context, op Instruction) { v.state = haltState } + case CAT, SUBSTR, LEFT, RIGHT, CHECKSIG, CHECKMULTISIG, + UNPACK, REVERSE, REMOVE: + panic("unimplemented") + // Cryptographic operations. case SHA1: b := v.estack.Pop().Bytes() @@ -738,12 +735,6 @@ func (v *VM) execute(ctx *Context, op Instruction) { b := v.estack.Pop().Bytes() v.estack.PushVal(hash.DoubleSha256(b).Bytes()) - case CHECKSIG: - // pubkey := v.estack.Pop().Bytes() - // sig := v.estack.Pop().Bytes() - - case CHECKMULTISIG: - case NOP: // unlucky ^^