vm: specify syscall ID when panicing on syscall invocation

It's convinient to know the failing syscall without dumping
smartcontract instructions.
This commit is contained in:
Anna Shaleva 2021-03-31 13:52:53 +03:00
parent 1bd3ee299c
commit 793f27084b

View file

@ -1304,7 +1304,7 @@ func (v *VM) execute(ctx *Context, op opcode.Opcode, parameter []byte) (err erro
interopID := GetInteropID(parameter) interopID := GetInteropID(parameter)
err := v.SyscallHandler(v, interopID) err := v.SyscallHandler(v, interopID)
if err != nil { if err != nil {
panic(fmt.Sprintf("failed to invoke syscall: %s", err)) panic(fmt.Sprintf("failed to invoke syscall %d: %s", interopID, err))
} }
case opcode.RET: case opcode.RET: