mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 03:38:35 +00:00
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{
|
||||
stackitem.NewByteArray(notifications[i].ScriptHash.BytesBE()),
|
||||
stackitem.Make(notifications[i].Name),
|
||||
notifications[i].Item,
|
||||
stackitem.DeepCopy(notifications[i].Item).(*stackitem.Array),
|
||||
})
|
||||
arr.Append(ev)
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ func runtimeNotify(ic *interop.Context, v *vm.VM) error {
|
|||
ne := state.NotificationEvent{
|
||||
ScriptHash: v.GetCurrentScriptHash(),
|
||||
Name: name,
|
||||
Item: stackitem.NewArray(args),
|
||||
Item: stackitem.DeepCopy(stackitem.NewArray(args)).(*stackitem.Array),
|
||||
}
|
||||
ic.Notifications = append(ic.Notifications, ne)
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue