示例#1
0
        /// <summary>
        /// Sends a notification for the specified contract.
        /// </summary>
        /// <param name="hash">The hash of the specified contract.</param>
        /// <param name="eventName">The name of the event.</param>
        /// <param name="state">The arguments of the event.</param>
        protected internal void SendNotification(UInt160 hash, string eventName, Array state)
        {
            NotifyEventArgs notification = new(ScriptContainer, hash, eventName, (Array)state.DeepCopy());

            Notify?.Invoke(this, notification);
            notifications ??= new List <NotifyEventArgs>();
            notifications.Add(notification);
        }
        /// <summary>
        /// Sends a notification for the specified contract.
        /// </summary>
        /// <param name="hash">The hash of the specified contract.</param>
        /// <param name="eventName">The name of the event.</param>
        /// <param name="state">The arguments of the event.</param>
        protected internal void SendNotification(UInt160 hash, string eventName, Array state)
        {
            NotifyEventArgs notification = new(ScriptContainer, hash, eventName, (Array)state.DeepCopy(asImmutable: true));

            Notify?.Invoke(this, notification);
            notifications ??= new List <NotifyEventArgs>();
            notifications.Add(notification);
            CurrentContext.GetState <ExecutionContextState>().NotificationCount++;
        }