Пример #1
0
            public Task HandleAsync(TransactionLogWrapper transactionLog)
            {
                var eventValues = transactionLog.Decode <TransferEvent>();

                EventsHandled.Add((transactionLog, eventValues));
                return(Task.CompletedTask);
            }
Пример #2
0
        public async Task HandleAsync(TransactionLogWrapper transactionLog)
        {
            try
            {
                if (!transactionLog.IsForEvent <TEvent>())
                {
                    return;
                }

                var eventValues = transactionLog.Decode <TEvent>();
                if (eventValues == null)
                {
                    return;
                }

                _currentBatch.Enqueue(eventValues);
                if (_currentBatch.Count == _logsPerIndexBatch)
                {
                    await _indexer.IndexAsync(_currentBatch);

                    _currentBatch.Clear();
                }
            }
            catch (Exception)
            {
                //Error whilst handling transaction log
                //expected event signature may differ from the expected event.
            }
        }
Пример #3
0
            public Task HandleAsync(TransactionLogWrapper transactionLog)
            {
                try
                {
                    if (!transactionLog.IsForEvent <TransferEvent>())
                    {
                        return(Task.CompletedTask);
                    }

                    var eventValues = transactionLog.Decode <TransferEvent>();
                    TransferEventsHandled.Add((transactionLog, eventValues));
                }
                catch (Exception)
                {
                    //Error whilst handling transaction log
                    //expected event signature may differ from the expected event.
                    TransferEventsWithDifferentSignature.Add(transactionLog);
                }

                return(Task.CompletedTask);
            }
Пример #4
0
        public Task HandleAsync(TransactionLogWrapper transactionLog)
        {
            if (!transactionLog.IsForEvent <TEvent>())
            {
                return(Task.CompletedTask);
            }

            var eventValues = transactionLog.Decode <TEvent>();

            if (eventValues == null || eventValues.Event == null)
            {
                return(Task.CompletedTask);
            }

            System.Console.WriteLine($"[EVENT]");
            System.Console.WriteLine($"\t[{_eventName}]");
            foreach (var prop in eventValues.Event.GetType().GetProperties())
            {
                System.Console.WriteLine($"\t\t[{prop.Name}:{prop.GetValue(eventValues.Event) ?? "null"}]");
            }

            return(Task.CompletedTask);
        }
 public Task HandleAsync(TransactionLogWrapper transactionLog)
 {
     Log($"[TransactionLog] Hash:{transactionLog.Transaction.TransactionHash}, Index:{transactionLog.LogIndex}, Address:{transactionLog.Log.Address}");
     return(Task.CompletedTask);
 }
Пример #6
0
 public async Task HandleAsync(TransactionLogWrapper txLog)
 {
     await _transactionLogRepository.UpsertAsync(
         txLog.Log);
 }
Пример #7
0
 public Task HandleAsync(TransactionLogWrapper transactionLog)
 {
     EventsHandled.Add(transactionLog);
     return(Task.CompletedTask);
 }
Пример #8
0
 public async Task HandleAsync(TransactionLogWrapper txLog)
 {
     await TransactionLogRepository.UpsertAsync(
         txLog.Log).ConfigureAwait(false);
 }