mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-02 09:45:50 +00:00
vm: add generic stub for all unimplemented instructions
This commit is contained in:
parent
59de72f446
commit
3f40334979
1 changed files with 4 additions and 13 deletions
17
pkg/vm/vm.go
17
pkg/vm/vm.go
|
@ -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 ^^
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue