Пример #1
0
        public ConsensusService(IConsensusInformationGenerationService consensusInformationGenerationService,
                                IConsensusScheduler consensusScheduler, ConsensusControlInformation consensusControlInformation)
        {
            _consensusInformationGenerationService = consensusInformationGenerationService;
            _consensusControlInformation           = consensusControlInformation;
            _consensusScheduler = consensusScheduler;

            Logger = NullLogger <ConsensusService> .Instance;
        }
Пример #2
0
        public DPoSInformationGenerationService(IAccountService accountService,
                                                ConsensusControlInformation controlInformation, ISmartContractAddressService smartContractAddressService,
                                                ITransactionReadOnlyExecutionService transactionReadOnlyExecutionService)
        {
            _accountService                      = accountService;
            _controlInformation                  = controlInformation;
            _smartContractAddressService         = smartContractAddressService;
            _transactionReadOnlyExecutionService = transactionReadOnlyExecutionService;

            Logger = NullLogger <DPoSInformationGenerationService> .Instance;
        }
Пример #3
0
        private IConsensusInformationGenerationService GetConsensusInformationGenerationService(
            DPoSBehaviour behavior)
        {
            var information = new ConsensusControlInformation()
            {
                ConsensusCommand = new ConsensusCommand
                {
                    Hint = ByteString.CopyFrom(new DPoSHint
                    {
                        Behaviour = behavior
                    }.ToByteArray())
                }
            };

            return(new DPoSInformationGenerationService(_accountService, information, _smartContractAddressService,
                                                        _transactionReadOnlyExecutionService));
        }
Пример #4
0
 public ConsensusServiceTests()
 {
     _consensusService            = GetRequiredService <IConsensusService>();
     _consensusControlInformation = GetRequiredService <ConsensusControlInformation>();
 }