Exemplo n.º 1
0
        public void GetGasPricesFromRecentBlocks_IfLastFiveBlocksWithThreeTxAndFirstFourWithOne_CheckSixBlocks()
        {
            IBlockFinder   blockFinder        = GetBlockFinderForLastFiveBlocksWithThreeTxAndFirstFourWithOne();
            GasPriceOracle testGasPriceOracle = new(blockFinder, Substitute.For <ISpecProvider>())
            {
                IgnoreUnder = 1,
                BlockLimit  = 6
            };

            testGasPriceOracle.GetGasPriceEstimate();

            foreach (long receivedBlockNumber in Enumerable.Range(3, 5))
            {
                blockFinder.Received(1).FindBlock(Arg.Is <long>(l => l == receivedBlockNumber));
            }

            blockFinder.DidNotReceive().FindBlock(Arg.Is <long>(l => l <= 2));
        }