public AccountManager() { unitOfWork = new UnitOfWork(); addressRepository = new AddressRepository(unitOfWork); userRepository = new UserRepository(unitOfWork); statesRepository = new StatesRepository(unitOfWork); webMembershipRepository = new WebMembershipRepository(unitOfWork); userSecQuestionRepository = new UserSecQuestionRepository(unitOfWork); }
public SynchronizationConfirmedVerifier(IStatesRepository statesRepository, IHashCalculationsRepository proofOfWorkCalculationRepository, ICryptoService cryptoService, ILoggerService loggerService) { _synchronizationContext = statesRepository.GetInstance <ISynchronizationContext>(); }
public SynchronizationGroupParticipationService(ISynchronizationProducer synchronizationProducer, IStatesRepository statesRepository, INodesRatingProviderFactory nodesRatingProvidersFactory, ILoggerService loggerService) { _synchronizationProducer = synchronizationProducer; _nodesRatingProvider = nodesRatingProvidersFactory.GetInstance(PacketType.Transactional); _synchronizationContext = statesRepository.GetInstance <ISynchronizationContext>(); _accountState = statesRepository.GetInstance <IAccountState>(); _synchronizationGroupState = statesRepository.GetInstance <ISynchronizationGroupState>(); _synchronizationGroupParticipationCheckAction = new TransformBlock <string, string>((Func <string, string>)SynchronizationGroupParticipationCheckAction, new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 1 }); _synchronizationGroupLeaderCheckAction = new ActionBlock <string>((Action <string>)SynchronizationGroupLeaderCheckAction, new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 1 }); _logger = loggerService.GetLogger(nameof(SynchronizationGroupParticipationService)); }
public void GetMostConfidentFullBlockTest() { List <RegistryFullBlock> registryFullBlocks = new List <RegistryFullBlock>(); List <RegistryShortBlock> registryShortBlocks = new List <RegistryShortBlock>(); Dictionary <IKey, int> votesPerShortBlockKey = new Dictionary <IKey, int>(); int fullBlockCount = 10; int votersCount = 100; ulong syncBlockHeight = 1; ulong blockHeight = 12; uint nonce = 0; byte[] powHash = BinaryHelper.GetPowHash(1234); IHashCalculation hashCalculationTransactionKey = new MurMurHashCalculation(); IHashCalculation hashCalculationDefault = new Keccak256HashCalculation(); IHashCalculation hashCalculationMurMur = new MurMurHashCalculation(); ISerializersFactory serializersFactory = Substitute.For <ISerializersFactory>(); IHashCalculationsRepository hashCalculationsRepository = Substitute.For <IHashCalculationsRepository>(); IIdentityKeyProvider identityKeyProviderTransactionKey = Substitute.For <IIdentityKeyProvider>(); IIdentityKeyProvidersRegistry identityKeyProvidersRegistry = Substitute.For <IIdentityKeyProvidersRegistry>(); ISigningService signingService = GetRandomCryptoService(); ILoggerService loggerService = Substitute.For <ILoggerService>(); IStatesRepository statesRepository = Substitute.For <IStatesRepository>(); ISynchronizationContext synchronizationContext = new Wist.Core.Synchronization.SynchronizationContext(loggerService); statesRepository.GetInstance <ISynchronizationContext>().ReturnsForAnyArgs(synchronizationContext); identityKeyProviderTransactionKey.GetKey(null).ReturnsForAnyArgs(c => new Key16(c.ArgAt <Memory <byte> >(0))); identityKeyProvidersRegistry.GetInstance("DefaultHash").Returns(new DefaultHashKeyProvider()); identityKeyProvidersRegistry.GetTransactionsIdenityKeyProvider().Returns(identityKeyProviderTransactionKey); hashCalculationsRepository.Create(HashType.Keccak256).Returns(hashCalculationDefault); hashCalculationsRepository.Create(HashType.MurMur).Returns(hashCalculationMurMur); serializersFactory.Create(null).ReturnsForAnyArgs(c => { RegistryShortBlockSerializer registryShortBlockSerializer = new RegistryShortBlockSerializer(); registryShortBlockSerializer.Initialize(c.Arg <SignedPacketBase>()); return(registryShortBlockSerializer); }); SyncRegistryMemPool syncRegistryMemPool = new SyncRegistryMemPool(loggerService, hashCalculationsRepository); for (int i = 0; i < fullBlockCount; i++) { ISigningService signingService1 = GetRandomCryptoService(); ushort expectedCount = 1000; SortedList <ushort, RegistryRegisterBlock> transactionHeaders = GetTransactionHeaders(syncBlockHeight, blockHeight, nonce, expectedCount); WitnessStateKey[] transactionHeaderKeys = GetTransactionHeaderKeys(transactionHeaders); RegistryShortBlock registryShortBlock = new RegistryShortBlock { SyncBlockHeight = syncBlockHeight, BlockHeight = blockHeight, Nonce = nonce, PowHash = powHash, WitnessStateKeys = transactionHeaderKeys }; RegistryShortBlockSerializer registryShortBlockSerializer = new RegistryShortBlockSerializer(); registryShortBlockSerializer.Initialize(registryShortBlock); registryShortBlockSerializer.SerializeBody(); signingService1.Sign(registryShortBlock); registryShortBlockSerializer.SerializeFully(); RegistryFullBlock registryFullBlock = new RegistryFullBlock { SyncBlockHeight = syncBlockHeight, BlockHeight = blockHeight, Nonce = nonce, PowHash = powHash, StateWitnesses = transactionHeaders.Values.ToArray(), ShortBlockHash = hashCalculationDefault.CalculateHash(registryShortBlock.RawData) }; RegistryFullBlockSerializer serializer = new RegistryFullBlockSerializer(); serializer.Initialize(registryFullBlock); serializer.SerializeBody(); signingService.Sign(registryFullBlock); serializer.SerializeFully(); registryFullBlocks.Add(registryFullBlock); registryShortBlocks.Add(registryShortBlock); } foreach (RegistryFullBlock fullBlock in registryFullBlocks) { syncRegistryMemPool.AddCandidateBlock(fullBlock); } IKey expectedMostConfidentKey = votesPerShortBlockKey.OrderByDescending(kv => kv.Value).Select(kv => kv.Key).First(); IEnumerable <RegistryFullBlock> actualFullBlocks = syncRegistryMemPool.GetRegistryBlocks(); }
public SyncConfirmedLoadModule(ILoggerService loggerService, IClientCommunicationServiceRepository clientCommunicationServiceRepository, IConfigurationService configurationService, IIdentityKeyProvidersRegistry identityKeyProvidersRegistry, ISerializersFactory signatureSupportSerializersFactory, INodesDataService nodesDataService, ISigningService cryptoService, IPerformanceCountersRepository performanceCountersRepository, IStatesRepository statesRepository, IHashCalculationsRepository hashCalculationRepository) : base(loggerService, clientCommunicationServiceRepository, configurationService, identityKeyProvidersRegistry, signatureSupportSerializersFactory, nodesDataService, cryptoService, performanceCountersRepository, hashCalculationRepository) { _synchronizationContext = statesRepository.GetInstance <ISynchronizationContext>(); }
public StatesController(IStatesRepository statesRepository) { this.statesRepository = statesRepository; }
public StatesApiController(IStatesRepository statesRepo, ILoggerFactory loggerFactory) { _StatesRepository = statesRepo; _Logger = loggerFactory.CreateLogger(nameof(StatesApiController)); }
public InteractionModule(ILoggerService loggerService, IConfigurationService configurationService, IStatesRepository statesRepository, IChainDataServicesManager chainDataServicesManager, IIdentityKeyProvidersRegistry identityKeyProvidersRegistry, IHashCalculationsRepository hashCalculationsRepository) : base(loggerService) { _synchronizationContext = statesRepository.GetInstance <ISynchronizationContext>(); _configurationService = configurationService; _chainDataServicesManager = chainDataServicesManager; _identityKeyProvidersRegistry = identityKeyProvidersRegistry; _hashCalculationsRepository = hashCalculationsRepository; }
public WalletManager(INetworkAdapter networkAdapter, IBlockCreator blockCreator, IDataAccessService dataAccessService, IHashCalculationsRepository hashCalculationsRepository, IIdentityKeyProvidersRegistry identityKeyProvidersRegistry, IStatesRepository statesRepository, ISerializersFactory signatureSupportSerializersFactory, IBlockParsersRepositoriesRepository blockParsersRepositoriesRepository) { _networkAdapter = networkAdapter; _blockCreator = blockCreator; _dataAccessService = dataAccessService; _signatureSupportSerializersFactory = signatureSupportSerializersFactory; _blockParsersRepositoriesRepository = blockParsersRepositoriesRepository; _heightsDictionary = new Dictionary <byte[], ulong>(); _hashCalculation = hashCalculationsRepository.Create(Globals.DEFAULT_HASH); _proofOfWorkCalculation = hashCalculationsRepository.Create(Globals.POW_TYPE); _identityKeyProvider = identityKeyProvidersRegistry.GetInstance(); _clientState = statesRepository.GetInstance <IClientState>(); }
public CartController(IProductsRepository repo, IOrderProcessor proc, IStatesRepository state) { repository = repo; orderProcessor = proc; stateRepo = state; }
public States(IUnitOfWork unitOfWork, IStatesRepository _statesRepository) { this.unitOfWork = unitOfWork; this._statesRepository = _statesRepository; }
public StateFilteringProvider(ITasksSourceJiraCacheAdapter jiraCacheAdapter, IStatesRepository statesRepository) { _stateFiltering = new StateFiltering(jiraCacheAdapter, statesRepository); }
public StatesController(IStatesRepository statesRepository, ILoggerFactory loggerFactory) { _statesRepository = statesRepository; _logger = loggerFactory.CreateLogger(nameof(StatesController)); }
public void GetMostConfidentFullBlockTest() { List <RegistryFullBlock> registryFullBlocks = new List <RegistryFullBlock>(); List <RegistryShortBlock> registryShortBlocks = new List <RegistryShortBlock>(); Dictionary <IKey, int> votesPerShortBlockKey = new Dictionary <IKey, int>(); int fullBlockCount = 10; int votersCount = 100; ulong syncBlockHeight = 1; ulong blockHeight = 12; uint nonce = 0; byte[] powHash = BinaryBuilder.GetPowHash(1234); IHashCalculation hashCalculationTransactionKey = new MurMurHashCalculation(); IHashCalculation hashCalculationDefault = new Keccak256HashCalculation(); IHashCalculation hashCalculationMurMur = new MurMurHashCalculation(); ISerializersFactory signatureSupportSerializersFactory = Substitute.For <ISerializersFactory>(); IHashCalculationsRepository hashCalculationsRepository = Substitute.For <IHashCalculationsRepository>(); IIdentityKeyProvider identityKeyProviderTransactionKey = Substitute.For <IIdentityKeyProvider>(); IIdentityKeyProvidersRegistry identityKeyProvidersRegistry = Substitute.For <IIdentityKeyProvidersRegistry>(); ICryptoService cryptoService = GetRandomCryptoService(); ILoggerService loggerService = Substitute.For <ILoggerService>(); IStatesRepository statesRepository = Substitute.For <IStatesRepository>(); ISynchronizationContext synchronizationContext = new Wist.Core.Synchronization.SynchronizationContext(loggerService); statesRepository.GetInstance <ISynchronizationContext>().ReturnsForAnyArgs(synchronizationContext); identityKeyProviderTransactionKey.GetKey(null).ReturnsForAnyArgs(c => new Key16(c.ArgAt <Memory <byte> >(0))); identityKeyProvidersRegistry.GetInstance("DefaultHash").Returns(new DefaultHashKeyProvider()); identityKeyProvidersRegistry.GetTransactionsIdenityKeyProvider().Returns(identityKeyProviderTransactionKey); hashCalculationsRepository.Create(HashType.Keccak256).Returns(hashCalculationDefault); hashCalculationsRepository.Create(HashType.MurMur).Returns(hashCalculationMurMur); signatureSupportSerializersFactory.Create(null).ReturnsForAnyArgs(c => { RegistryShortBlockSerializer registryShortBlockSerializer = new RegistryShortBlockSerializer(cryptoService, identityKeyProvidersRegistry, hashCalculationsRepository); registryShortBlockSerializer.Initialize(c.Arg <SignedBlockBase>()); return(registryShortBlockSerializer); }); SyncRegistryMemPool syncRegistryMemPool = new SyncRegistryMemPool(signatureSupportSerializersFactory, hashCalculationsRepository, identityKeyProvidersRegistry, cryptoService, statesRepository, loggerService); for (int i = 0; i < fullBlockCount; i++) { ICryptoService cryptoService1 = GetRandomCryptoService(); ushort expectedCount = 1000; SortedList <ushort, ITransactionRegistryBlock> transactionHeaders = GetTransactionHeaders(syncBlockHeight, blockHeight, nonce, expectedCount); SortedList <ushort, IKey> transactionHeaderKeys = GetTransactionHeaderKeys(hashCalculationTransactionKey, transactionHeaders); RegistryShortBlock registryShortBlock = new RegistryShortBlock { SyncBlockHeight = syncBlockHeight, BlockHeight = blockHeight, Nonce = nonce, PowHash = powHash, TransactionHeaderHashes = transactionHeaderKeys }; RegistryShortBlockSerializer registryShortBlockSerializer = new RegistryShortBlockSerializer(cryptoService1, identityKeyProvidersRegistry, hashCalculationsRepository); registryShortBlockSerializer.Initialize(registryShortBlock); registryShortBlockSerializer.FillBodyAndRowBytes(); RegistryFullBlock registryFullBlock = new RegistryFullBlock { SyncBlockHeight = syncBlockHeight, BlockHeight = blockHeight, Nonce = nonce, PowHash = powHash, TransactionHeaders = transactionHeaders, ShortBlockHash = hashCalculationDefault.CalculateHash(registryShortBlock.RawData) }; RegistryFullBlockSerializer serializer = new RegistryFullBlockSerializer(cryptoService1, identityKeyProvidersRegistry, hashCalculationsRepository); serializer.Initialize(registryFullBlock); serializer.FillBodyAndRowBytes(); registryFullBlocks.Add(registryFullBlock); registryShortBlocks.Add(registryShortBlock); } foreach (RegistryFullBlock fullBlock in registryFullBlocks) { syncRegistryMemPool.AddCandidateBlock(fullBlock); } Random random = new Random(); for (int i = 0; i < votersCount; i++) { ICryptoService cryptoService2 = GetRandomCryptoService(); foreach (var registryShortBlock in registryShortBlocks) { byte[] hashBytes = hashCalculationDefault.CalculateHash(registryShortBlock.RawData); Random randNum = new Random(); byte[] bitMask = Enumerable.Repeat(0, registryShortBlock.TransactionHeaderHashes.Count).Select(j => (byte)randNum.Next(0, 255)).ToArray(); byte[] expectedProof = Enumerable.Repeat(0, 16).Select(j => (byte)randNum.Next(0, 255)).ToArray(); IKey shortBlockKey = new Key32(hashBytes); long vote = GetConfidence(bitMask); if (!votesPerShortBlockKey.ContainsKey(shortBlockKey)) { votesPerShortBlockKey.Add(shortBlockKey, (ushort)vote); } else { votesPerShortBlockKey[shortBlockKey] += (ushort)vote; } RegistryConfidenceBlock registryConfidenceBlock = new RegistryConfidenceBlock { SyncBlockHeight = syncBlockHeight, BlockHeight = blockHeight, Nonce = nonce, PowHash = powHash, ReferencedBlockHash = hashBytes, BitMask = bitMask, ConfidenceProof = expectedProof }; RegistryConfidenceBlockSerializer registryConfidenceBlockSerializer = new RegistryConfidenceBlockSerializer(cryptoService2, identityKeyProvidersRegistry, hashCalculationsRepository); registryConfidenceBlockSerializer.Initialize(registryConfidenceBlock); registryConfidenceBlockSerializer.FillBodyAndRowBytes(); syncRegistryMemPool.AddVotingBlock(registryConfidenceBlock); } } IKey expectedMostConfidentKey = votesPerShortBlockKey.OrderByDescending(kv => kv.Value).Select(kv => kv.Key).First(); RegistryFullBlock actualFullBlock = syncRegistryMemPool.GetMostConfidentFullBlock(blockHeight); IKey actualMostConfidentKey = new Key32(actualFullBlock.ShortBlockHash); Assert.Equal(expectedMostConfidentKey, actualMostConfidentKey); }
public UtxoConfidentialStorageHandler(IStatesRepository statesRepository, IServerCommunicationServicesRegistry communicationServicesRegistry, IRawPacketProvidersFactory rawPacketProvidersFactory, IRegistryMemPool registryMemPool, IConfigurationService configurationService, IHashCalculationsRepository hashCalculationRepository, IChainDataServicesManager chainDataServicesManager) : base(statesRepository, communicationServicesRegistry, rawPacketProvidersFactory, registryMemPool, configurationService, hashCalculationRepository, chainDataServicesManager) { }
public ResultsViewModel(IDataAccessService dataAccessService, IWalletManager walletManager, IBlockParsersRepositoriesRepository blockParsersRepositoriesRepository, IStatesRepository statesRepository) { _dataAccessService = dataAccessService; _walletManager = walletManager; _blockParsersRepositoriesRepository = blockParsersRepositoriesRepository; _clientState = statesRepository.GetInstance <IClientState>(); Utxos = new ObservableCollection <UtxoIncomingBlockDesc>(); }
public SyncRegistryMemPool(ISerializersFactory signatureSupportSerializersFactory, IHashCalculationsRepository hashCalculationsRepository, IIdentityKeyProvidersRegistry identityKeyProvidersRegistry, ICryptoService cryptoService, IStatesRepository statesRepository, ILoggerService loggerService) { _synchronizationContext = statesRepository.GetInstance <ISynchronizationContext>(); _roundDescriptors = new Dictionary <ulong, RoundDescriptor>(); _signatureSupportSerializersFactory = signatureSupportSerializersFactory; _cryptoService = cryptoService; _defaultTransactionHashCalculation = hashCalculationsRepository.Create(Globals.DEFAULT_HASH); _transactionHashKey = identityKeyProvidersRegistry.GetInstance("DefaultHash"); _logger = loggerService.GetLogger(nameof(SyncRegistryMemPool)); }
public LoginViewModel(IStatesRepository statesRepository, ICryptoService cryptoService) { _clientState = statesRepository.GetInstance <IClientState>(); _cryptoService = cryptoService; }
public StorageHandlerBase(IStatesRepository statesRepository, IServerCommunicationServicesRegistry communicationServicesRegistry, IRawPacketProvidersFactory rawPacketProvidersFactory, IRegistryMemPool registryMemPool, IConfigurationService configurationService, IHashCalculationsRepository hashCalculationRepository, IChainDataServicesManager chainDataServicesManager) { _nodeContext = statesRepository.GetInstance <INodeContext>(); _communicationServicesRegistry = communicationServicesRegistry; _chainDataServicesManager = chainDataServicesManager; }
//private read-only IBlocksProcessor _blocksProcessor public NodeMain(IServerCommunicationServicesRepository communicationServicesFactory, IServerCommunicationServicesRegistry communicationServicesRegistry, IConfigurationService configurationService, IModulesRepository modulesRepository, IPacketsHandler packetsHandler, IBlocksHandlersRegistry blocksProcessorFactory, ILoggerService loggerService, ICryptoService cryptoService, IStatesRepository statesRepository) { _log = loggerService.GetLogger(GetType().Name); _communicationServicesFactory = communicationServicesFactory; _communicationServicesRegistry = communicationServicesRegistry; _configurationService = configurationService; _modulesRepository = modulesRepository; _packetsHandler = packetsHandler; _cryptoService = cryptoService; _nodeContext = statesRepository.GetInstance <INodeContext>(); _accountState = statesRepository.GetInstance <IAccountState>(); _cancellationTokenSource = new CancellationTokenSource(); }
public CommonTopologyInitializer(IStatesRepository statesRepository, INodesDataService nodesDataService, ILoggerService loggerService) { _neighborhoodState = statesRepository.GetInstance <INeighborhoodState>(); _nodesDataService = nodesDataService; _logger = loggerService.GetLogger(nameof(CommonTopologyInitializer)); }
public void MemPool_AddedNonUniqueTransactions_NotAllContained() { SynchronizationDescriptor synchronizationDescriptor = new SynchronizationDescriptor(1, new byte[Globals.DEFAULT_HASH_SIZE], DateTime.Now, DateTime.Now, 1); IHash transactionKeyHash = HashFactory.Hash128.CreateMurmur3_128(); ILogger logger = Substitute.For <ILogger>(); ILoggerService loggerService = Substitute.For <ILoggerService>(); IIdentityKeyProvider identityKeyProvider = new TransactionRegistryKeyProvider(); IIdentityKeyProvidersRegistry identityKeyProvidersRegistry = Substitute.For <IIdentityKeyProvidersRegistry>(); IHashCalculationsRepository hashCalculationsRepository = Substitute.For <IHashCalculationsRepository>(); ICryptoService cryptoService = Substitute.For <ICryptoService>(); SynchronizationContext synchronizationContext = new SynchronizationContext(loggerService); synchronizationContext.UpdateLastSyncBlockDescriptor(synchronizationDescriptor); IStatesRepository statesRepository = Substitute.For <IStatesRepository>(); hashCalculationsRepository.Create(HashType.MurMur).Returns(new MurMurHashCalculation()); logger.WhenForAnyArgs(l => l.Error(null)).DoNotCallBase(); logger.WhenForAnyArgs(l => l.Warning(null)).DoNotCallBase(); logger.WhenForAnyArgs(l => l.Info(null)).DoNotCallBase(); loggerService.GetLogger(null).Returns(logger); identityKeyProvidersRegistry.GetTransactionsIdenityKeyProvider().ReturnsForAnyArgs(identityKeyProvider); //identityKeyProvider.GetKey(null).ReturnsForAnyArgs(c => new Key16() { Value = c.Arg<Memory<byte>>() }); statesRepository.GetInstance <ISynchronizationContext>().Returns(synchronizationContext); byte[] privateKey = CryptoHelper.GetRandomSeed(); Ed25519.KeyPairFromSeed(out byte[] publicKey, out byte[] expandedPrivateKey, privateKey); cryptoService.ComputeTransactionKey(new Memory <byte>()).ReturnsForAnyArgs(c => transactionKeyHash.ComputeBytes(c.Arg <Memory <byte> >().ToArray()).GetBytes()); cryptoService.ComputeTransactionKey(new byte[0]).ReturnsForAnyArgs(c => transactionKeyHash.ComputeBytes(c.Arg <byte[]>()).GetBytes()); cryptoService.Sign(null).ReturnsForAnyArgs(c => Ed25519.Sign(c.Arg <byte[]>(), expandedPrivateKey)); cryptoService.PublicKey.ReturnsForAnyArgs(new Key32(publicKey)); TransactionRegistryMemPool transactionRegistryMemPool = new TransactionRegistryMemPool(loggerService, identityKeyProvidersRegistry, cryptoService, statesRepository, new TransactionsRegistryHelper(cryptoService, identityKeyProvidersRegistry), hashCalculationsRepository); SortedList <ushort, RegistryRegisterBlock> expectedBlocks = new SortedList <ushort, RegistryRegisterBlock>(); ulong[] heights = new ulong[] { 1, 2, 2, 5, 4, 3, 4, 3, 4, 5, 3 }; HashSet <ulong> addedHeights = new HashSet <ulong>(); ushort order = 0; for (ulong i = 0; i < (ulong)heights.Length; i++) { RegistryRegisterBlock transactionRegisterBlock = PacketsBuilder.GetTransactionRegisterBlock(synchronizationContext.LastBlockDescriptor.BlockHeight, 1, null, heights[i], PacketType.Transactional, BlockTypes.Transaction_TransferFunds, new byte[Globals.POW_HASH_SIZE], new byte[Globals.DEFAULT_HASH_SIZE], privateKey); RegistryRegisterBlockSerializer serializer = new RegistryRegisterBlockSerializer(cryptoService, identityKeyProvidersRegistry, hashCalculationsRepository); serializer.Initialize(transactionRegisterBlock); serializer.FillBodyAndRowBytes(); if (!addedHeights.Contains(heights[i])) { expectedBlocks.Add(order++, transactionRegisterBlock); addedHeights.Add(heights[i]); } transactionRegistryMemPool.EnqueueTransactionRegisterBlock(transactionRegisterBlock); } SortedList <ushort, ITransactionRegistryBlock> actualBlocks = transactionRegistryMemPool.DequeueBulk(-1); Assert.Equal(expectedBlocks.Count, actualBlocks.Count); for (ushort i = 0; i < (ushort)expectedBlocks.Count; i++) { Assert.Equal(expectedBlocks[i].BlockHeight, ((RegistryRegisterBlock)actualBlocks[i]).BlockHeight); } }
public RegistryTopologyInitializer(IStatesRepository statesRepository, INodesDataService nodesDataService, ILoggerService loggerService) { _registryGroupState = statesRepository.GetInstance <IRegistryGroupState>(); _nodesDataService = nodesDataService; _logger = loggerService.GetLogger(nameof(RegistryTopologyInitializer)); }
public StatesController(IStatesRepository repo) { _repo = repo; }
public SyncHeightVerifier(IStatesRepository statesRepository, IHashCalculationsRepository hashCalculationsRepository, ILoggerService loggerService) { _log = loggerService.GetLogger(GetType().Name); _synchronizationContext = statesRepository.GetInstance <ISynchronizationContext>(); _proofOfWorkCalculation = hashCalculationsRepository.Create(Globals.POW_TYPE); }
public TransactionRegistrationLoadModule(ILoggerService loggerService, IClientCommunicationServiceRepository clientCommunicationServiceRepository, IConfigurationService configurationService, IIdentityKeyProvidersRegistry identityKeyProvidersRegistry, ISerializersFactory signatureSupportSerializersFactory, INodesDataService nodesDataService, ICryptoService cryptoService, IPerformanceCountersRepository performanceCountersRepository, IStatesRepository statesRepository, IHashCalculationsRepository proofOfWorkCalculationRepository, IHashCalculationsRepository hashCalculationRepository) : base(loggerService, clientCommunicationServiceRepository, configurationService, identityKeyProvidersRegistry, signatureSupportSerializersFactory, nodesDataService, cryptoService, performanceCountersRepository, hashCalculationRepository) { _synchronizationContext = statesRepository.GetInstance <ISynchronizationContext>(); _proofOfWorkCalculation = proofOfWorkCalculationRepository.Create(Globals.POW_TYPE); }
public SynchronizationProducer(ISerializersFactory signatureSupportSerializersFactory, IStatesRepository statesRepository, IServerCommunicationServicesRegistry communicationServicesRegistry, IConfigurationService configurationService, IHashCalculationsRepository hashCalculationsRepository) { _signatureSupportSerializersFactory = signatureSupportSerializersFactory; _nodeContext = statesRepository.GetInstance <INodeContext>(); _synchronizationContext = statesRepository.GetInstance <ISynchronizationContext>(); _synchronizationGroupState = statesRepository.GetInstance <ISynchronizationGroupState>(); _communicationServicesRegistry = communicationServicesRegistry; _configurationService = configurationService; _proofOfWorkCalculation = hashCalculationsRepository.Create(Globals.POW_TYPE); }
public ShardsManager(IStatesRepository statesRepository, INodesDataService nodesDataService) { _synchronizationContext = statesRepository.GetInstance <ISynchronizationContext>(); _syncContextChangedUnsibscriber = _synchronizationContext.SubscribeOnStateChange(new ActionBlock <string>((Action <string>)OnSyncContextChanged)); _nodesDataService = nodesDataService; }