Esempio n. 1
0
        public static BlockHeader GetHeader(this IBlockFinder blockFinder, FilterBlock blockFilter)
        {
            switch (blockFilter.Type)
            {
            case FilterBlockType.Pending:
                return(blockFinder.FindPendingHeader());

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

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

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

            default:
                throw new ArgumentException($"{nameof(FilterBlockType)} not supported: {blockFilter.Type}");
            }
        }
Esempio n. 2
0
 public BlockHeader FindPendingHeader() => _blockFinder.FindPendingHeader();