Пример #1
0
        public Eth2BlockProducer Create(
            IBlockProducerEnvFactory blockProducerEnvFactory,
            IBlockTree blockTree,
            IBlockProductionTrigger blockProductionTrigger,
            ISpecProvider specProvider,
            ISigner engineSigner,
            ITimestamper timestamper,
            IMiningConfig miningConfig,
            ILogManager logManager)
        {
            BlockProducerEnv producerEnv = GetProducerEnv(blockProducerEnvFactory);

            return(new Eth2BlockProducer(
                       producerEnv.TxSource,
                       producerEnv.ChainProcessor,
                       blockTree,
                       blockProductionTrigger,
                       producerEnv.ReadOnlyStateProvider,
                       _gasLimitCalculator ?? new TargetAdjustedGasLimitCalculator(specProvider, miningConfig),
                       engineSigner,
                       timestamper,
                       specProvider,
                       logManager));
        }
Пример #2
0
 protected BlockProducerEnv GetProducerEnv(IBlockProducerEnvFactory blockProducerEnvFactory) =>
 blockProducerEnvFactory.Create(_additionalTxSource);