From 793f27084b7383f5de460d6698d89399153d8b44 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 31 Mar 2021 13:52:53 +0300 Subject: [PATCH] vm: specify syscall ID when panicing on syscall invocation It's convinient to know the failing syscall without dumping smartcontract instructions. --- pkg/vm/vm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/vm/vm.go b/pkg/vm/vm.go index 2c887cb86..dc8198ed8 100644 --- a/pkg/vm/vm.go +++ b/pkg/vm/vm.go @@ -1304,7 +1304,7 @@ func (v *VM) execute(ctx *Context, op opcode.Opcode, parameter []byte) (err erro interopID := GetInteropID(parameter) err := v.SyscallHandler(v, interopID) 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: