public void SetUp() { _auRaParameters = new AuRaParameters(); _auRaStepCalculator = Substitute.For <IAuRaStepCalculator>(); _logManager = LimboLogs.Instance; _wallet = new DevWallet(new WalletConfig(), _logManager); _address = _wallet.NewAccount(new NetworkCredential(string.Empty, "AAA").SecurePassword); _ethereumEcdsa = Substitute.For <IEthereumEcdsa>(); _currentStep = 11; _auRaStepCalculator.CurrentStep.Returns(_currentStep); _reportingValidator = Substitute.For <IReportingValidator>(); _blockTree = Substitute.For <IBlockTree>(); _validSealerStrategy = Substitute.For <IValidSealerStrategy>(); _sealValidator = new AuRaSealValidator(_auRaParameters, _auRaStepCalculator, _blockTree, Substitute.For <IValidatorStore>(), _validSealerStrategy, _ethereumEcdsa, _logManager) { ReportingValidator = _reportingValidator }; }
public TestAuraProducer(ITxSource transactionSource, IBlockchainProcessor processor, IStateProvider stateProvider, ISealer sealer, IBlockTree blockTree, IBlockProcessingQueue blockProcessingQueue, ITimestamper timestamper, ILogManager logManager, IAuRaStepCalculator auRaStepCalculator, IReportingValidator reportingValidator, IAuraConfig config, ISpecProvider specProvider) : base( transactionSource, processor, stateProvider, sealer, blockTree, blockProcessingQueue, timestamper, auRaStepCalculator, reportingValidator, config, FollowOtherMiners.Instance, specProvider, logManager) { }
public AuRaBlockProducer(ITxSource txSource, IBlockchainProcessor processor, IBlockProductionTrigger blockProductionTrigger, IStateProvider stateProvider, ISealer sealer, IBlockTree blockTree, ITimestamper timestamper, IAuRaStepCalculator auRaStepCalculator, IReportingValidator reportingValidator, IAuraConfig config, IGasLimitCalculator gasLimitCalculator, ISpecProvider specProvider, ILogManager logManager) : base( txSource, processor, sealer, blockTree, blockProductionTrigger, stateProvider, gasLimitCalculator, timestamper, specProvider, logManager, new AuraDifficultyCalculator(auRaStepCalculator)) { _auRaStepCalculator = auRaStepCalculator ?? throw new ArgumentNullException(nameof(auRaStepCalculator)); _reportingValidator = reportingValidator ?? throw new ArgumentNullException(nameof(reportingValidator)); _config = config ?? throw new ArgumentNullException(nameof(config)); }
public AuRaBlockProducer(ITxSource txSource, IBlockchainProcessor processor, IStateProvider stateProvider, ISealer sealer, IBlockTree blockTree, IBlockProcessingQueue blockProcessingQueue, ITimestamper timestamper, IAuRaStepCalculator auRaStepCalculator, IReportingValidator reportingValidator, IAuraConfig config, IGasLimitCalculator gasLimitCalculator, ISpecProvider specProvider, ILogManager logManager) : base( new ValidatedTxSource(txSource, logManager), processor, sealer, blockTree, blockProcessingQueue, stateProvider, timestamper, gasLimitCalculator, specProvider, logManager, "AuRa") { _auRaStepCalculator = auRaStepCalculator ?? throw new ArgumentNullException(nameof(auRaStepCalculator)); _reportingValidator = reportingValidator ?? throw new ArgumentNullException(nameof(reportingValidator)); _config = config ?? throw new ArgumentNullException(nameof(config)); _canProduce = _config.AllowAuRaPrivateChains ? 1 : 0; }