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}"); } }
public Block FindLatestBlock() => _blockFinder.FindLatestBlock();