public AuRaContractGasLimitOverride(IList <IBlockGasLimitContract> contracts, IGasLimitOverride.Cache cache, bool minimum2MlnGasPerBlockWhenUsingBlockGasLimitContract, ILogManager logManager)
 {
     _contracts = contracts ?? throw new ArgumentNullException(nameof(contracts));
     _cache     = cache ?? throw new ArgumentNullException(nameof(cache));
     _minimum2MlnGasPerBlockWhenUsingBlockGasLimitContract = minimum2MlnGasPerBlockWhenUsingBlockGasLimitContract;
     _logger = logManager?.GetClassLogger <AuRaContractGasLimitOverride>() ?? throw new ArgumentNullException(nameof(logManager));
 }
Beispiel #2
0
            protected override BlockProcessor CreateBlockProcessor()
            {
                var validator = new AuRaParameters.Validator()
                {
                    Addresses     = TestItem.Addresses,
                    ValidatorType = AuRaParameters.ValidatorType.List
                };

                var blockGasLimitContractTransition = this.ChainSpec.AuRa.BlockGasLimitContractTransitions.First();
                var gasLimitContract = new BlockGasLimitContract(new AbiEncoder(), blockGasLimitContractTransition.Value, blockGasLimitContractTransition.Key,
                                                                 new ReadOnlyTransactionProcessorSource(DbProvider, BlockTree, SpecProvider, LimboLogs.Instance));

                GasLimitOverrideCache = new IGasLimitOverride.Cache();
                GasLimitOverride      = new AuRaContractGasLimitOverride(new[] { gasLimitContract }, GasLimitOverrideCache, false, LimboLogs.Instance);

                return(new AuRaBlockProcessor(
                           SpecProvider,
                           Always.Valid,
                           new RewardCalculator(SpecProvider),
                           TxProcessor,
                           StateDb,
                           CodeDb,
                           State,
                           Storage,
                           TxPool,
                           ReceiptStorage,
                           LimboLogs.Instance,
                           BlockTree,
                           null,
                           GasLimitOverride));
            }