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()); }
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())); }
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()); }