vm: check return value on context unload

When calling external contracts we expect exactly 1 value to be on
stack. For methods returning nothing, `Null` value is pushed, otherwise
it is an error.`
This commit is contained in:
Evgenii Stratonikov 2020-08-10 11:52:32 +03:00
parent bbae7318a5
commit bf01599430
6 changed files with 57 additions and 0 deletions

View file

@ -519,6 +519,7 @@ func contractCallExInternal(ic *interop.Context, h []byte, name string, args []s
}
// use Jump not Call here because context was loaded in LoadScript above.
ic.VM.Jump(ic.VM.Context(), md.Offset)
ic.VM.Context().CheckReturn = true
}
md = cs.Manifest.ABI.GetMethod(manifest.MethodInit)