vm, core: push Null return value only if no exception occurs

Close https://github.com/nspcc-dev/neo-go/issues/2509.
This commit is contained in:
Anna Shaleva 2022-05-23 11:35:01 +03:00
parent ce226f6b76
commit 08b68e9b82
5 changed files with 178 additions and 14 deletions

View file

@ -63,8 +63,14 @@ type Context struct {
// isWrapped tells whether the context's DAO was wrapped into another layer of
// MemCachedStore on creation and whether it should be unwrapped on context unloading.
isWrapped bool
// onUnload is a callback that should be called after current context unloading
// if no exception occurs.
onUnload ContextUnloadCallback
}
// ContextUnloadCallback is a callback method used on context unloading from istack.
type ContextUnloadCallback func(parentEstack *Stack)
var errNoInstParam = errors.New("failed to read instruction parameter")
// NewContext returns a new Context object.