コード例 #1
0
        public FilterLog[] FindLogs(LogFilter filter)
        {
            var toBlock = _blockFinder.GetBlock(filter.ToBlock);

            if (toBlock is null)
            {
                return(Array.Empty <FilterLog>());
            }

            var fromBlock            = _blockFinder.GetBlock(filter.FromBlock);
            List <FilterLog> results = new List <FilterLog>();

            while (toBlock.Number >= (fromBlock?.Number ?? long.MaxValue))
            {
                if (filter.Matches(toBlock.Bloom))
                {
                    FindLogsInBlock(filter, toBlock, results);
                }

                if (!TryGetParentBlock(toBlock, out toBlock))
                {
                    break;
                }
            }

            return(results.ToArray());
        }
コード例 #2
0
        public ResultWrapper <ReceiptForRpc[]> parity_getBlockReceipts(BlockParameter blockParameter)
        {
            var filterBlock = blockParameter.ToFilterBlock();
            var block       = _blockFinder.GetBlock(filterBlock);
            var receipts    = _receiptStorage.FindForBlock(block);
            var result      = receipts.Zip(block.Transactions, (r, t) => new ReceiptForRpc(t.Hash, r));

            return(ResultWrapper <ReceiptForRpc[]> .Success(result.ToArray()));
        }
コード例 #3
0
ファイル: LogFinder.cs プロジェクト: vicnaum/nethermind
        public FilterLog[] FindLogs(LogFilter filter)
        {
            var toBlock              = _blockFinder.GetBlock(filter.ToBlock);
            var fromBlock            = _blockFinder.GetBlock(filter.FromBlock);
            List <FilterLog> results = new List <FilterLog>();

            while (toBlock.Number >= fromBlock.Number)
            {
                if (filter.Matches(toBlock.Bloom))
                {
                    FindLogsInBlock(filter, toBlock, results);
                }

                if (!TryGetParentBlock(toBlock, out toBlock))
                {
                    break;
                }
            }

            return(results.ToArray());
        }