public long?GetFinalizationLevel_tests(int chainLength, Address[] beneficiaries, int minForFinalization, long level)
        {
            SetupValidators(minForFinalization, beneficiaries);
            var blockTreeBuilder    = Build.A.BlockTree().OfChainLength(chainLength, 0, 0, beneficiaries);
            var blockTree           = blockTreeBuilder.TestObject;
            var finalizationManager = new AuRaBlockFinalizationManager(blockTree, blockTreeBuilder.ChainLevelInfoRepository, _blockProcessor, _validatorStore, _validSealerStrategy, _logManager);

            var result = finalizationManager.GetFinalizationLevel(level);

            return(result);
        }
        public long?GetFinalizationLevel_when_before_pivot_and_not_synced(int minForFinalization, long bestKnownBlock, long level)
        {
            SetupValidators(minForFinalization);
            IBlockTree blockTree = Substitute.For <IBlockTree>();

            blockTree.BestKnownNumber.Returns(bestKnownBlock);
            var finalizationManager = new AuRaBlockFinalizationManager(
                blockTree,
                Substitute.For <IChainLevelInfoRepository>(),
                _blockProcessor,
                _validatorStore,
                _validSealerStrategy,
                _logManager);

            return(finalizationManager.GetFinalizationLevel(level));
        }