Пример #1
0
        public static Block GetBlock(this IBlockFinder blockFinder, FilterBlock blockFilter)
        {
            switch (blockFilter.Type)
            {
            case FilterBlockType.Pending:
                return(blockFinder.FindPendingBlock());

            case FilterBlockType.Latest:
                return(blockFinder.FindLatestBlock());

            case FilterBlockType.Earliest:
                return(blockFinder.FindEarliestBlock());

            case FilterBlockType.BlockNumber:
                return(blockFinder.FindBlock(blockFilter.BlockNumber));

            default:
                throw new ArgumentException($"{nameof(FilterBlockType)} not supported: {blockFilter.Type}");
            }
        }
Пример #2
0
 public Block FindEarliestBlock() => _blockFinder.FindEarliestBlock();