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")
|
||||
}
|
||||
|
||||
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 ^^
|
||||
|
||||
|
|
Loading…
Reference in a new issue