Esempio n. 1
0
        public VotingManager(FederationManager federationManager, ILoggerFactory loggerFactory, SlotsManager slotsManager, IPollResultExecutor pollResultExecutor,
                             INodeStats nodeStats, DataFolder dataFolder, DBreezeSerializer dBreezeSerializer, ISignals signals, IFinalizedBlockInfoRepository finalizedBlockInfo)
        {
            this.federationManager  = Guard.NotNull(federationManager, nameof(federationManager));
            this.slotsManager       = Guard.NotNull(slotsManager, nameof(slotsManager));
            this.pollResultExecutor = Guard.NotNull(pollResultExecutor, nameof(pollResultExecutor));
            this.signals            = Guard.NotNull(signals, nameof(signals));
            this.nodeStats          = Guard.NotNull(nodeStats, nameof(nodeStats));
            this.finalizedBlockInfo = Guard.NotNull(finalizedBlockInfo, nameof(finalizedBlockInfo));

            this.locker              = new object();
            this.votingDataEncoder   = new VotingDataEncoder(loggerFactory);
            this.scheduledVotingData = new List <VotingData>();
            this.pollsRepository     = new PollsRepository(dataFolder, loggerFactory, dBreezeSerializer);
            this.logger              = loggerFactory.CreateLogger(this.GetType().FullName);

            this.isInitialized = false;
        }