Beispiel #1
0
        public async Task ProcessAsync(Block block, TransactionResult transactionResult, LogEvent logEvent)
        {
            var configurationSet = new ConfigurationSet();

            configurationSet.MergeFrom(logEvent);

            if (configurationSet.Key != BlockTransactionLimitConfigurationNameProvider.Name)
            {
                return;
            }

            var limit = new Int32Value();

            limit.MergeFrom(configurationSet.Value.ToByteArray());
            if (limit.Value < 0)
            {
                return;
            }
            await _blockTransactionLimitProvider.SetLimitAsync(new BlockIndex
            {
                BlockHash   = block.GetHash(),
                BlockHeight = block.Height
            }, limit.Value);

            Logger.LogInformation($"BlockTransactionLimit has been changed to {limit.Value}");
        }
Beispiel #2
0
        protected override async Task ProcessLogEventAsync(Block block, LogEvent logEvent)
        {
            var configurationSet = new ConfigurationSet();

            configurationSet.MergeFrom(logEvent);

            await _configurationService.ProcessConfigurationAsync(configurationSet.Key, configurationSet.Value,
                                                                  new BlockIndex
            {
                BlockHash   = block.GetHash(),
                BlockHeight = block.Height
            });
        }