forked from TrueCloudLab/neoneo-go
core: deepcopy notification in System.Runtime.Notify
Make it impossible to change already emitted notifications via `System.Runtime.GetNotifications`.
This commit is contained in:
parent
b8cc33d0b2
commit
194da64975
2 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ func GetNotifications(ic *interop.Context, v *vm.VM) error {
|
||||||
ev := stackitem.NewArray([]stackitem.Item{
|
ev := stackitem.NewArray([]stackitem.Item{
|
||||||
stackitem.NewByteArray(notifications[i].ScriptHash.BytesBE()),
|
stackitem.NewByteArray(notifications[i].ScriptHash.BytesBE()),
|
||||||
stackitem.Make(notifications[i].Name),
|
stackitem.Make(notifications[i].Name),
|
||||||
notifications[i].Item,
|
stackitem.DeepCopy(notifications[i].Item).(*stackitem.Array),
|
||||||
})
|
})
|
||||||
arr.Append(ev)
|
arr.Append(ev)
|
||||||
}
|
}
|
||||||
|
|
|
@ -282,7 +282,7 @@ func runtimeNotify(ic *interop.Context, v *vm.VM) error {
|
||||||
ne := state.NotificationEvent{
|
ne := state.NotificationEvent{
|
||||||
ScriptHash: v.GetCurrentScriptHash(),
|
ScriptHash: v.GetCurrentScriptHash(),
|
||||||
Name: name,
|
Name: name,
|
||||||
Item: stackitem.NewArray(args),
|
Item: stackitem.DeepCopy(stackitem.NewArray(args)).(*stackitem.Array),
|
||||||
}
|
}
|
||||||
ic.Notifications = append(ic.Notifications, ne)
|
ic.Notifications = append(ic.Notifications, ne)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Reference in a new issue