vm: extract shared parts of the Context

Local calls reuse them, cross-contract calls create new ones. This allows to
avoid some allocations and use a little less memory.
This commit is contained in:
Roman Khimov 2022-08-04 16:15:51 +03:00
parent e5c59f8ddd
commit 13f5fdbe8a
7 changed files with 112 additions and 108 deletions

View file

@ -73,7 +73,7 @@ func Notify(ic *interop.Context) error {
if len(name) > MaxEventNameLen {
return fmt.Errorf("event name must be less than %d", MaxEventNameLen)
}
if ic.VM.Context().NEF == nil {
if !ic.VM.Context().IsDeployed() {
return errors.New("notifications are not allowed in dynamic scripts")
}