Example #1
0
 public TransactionService(ITransactionStore transactionStore, IMatchingService matchingService, IUserService userService, INotificationService notificationService)
 {
     _transactionStore    = transactionStore;
     _matchingService     = matchingService;
     _userService         = userService;
     _notificationService = notificationService;
 }
Example #2
0
 public Clope(ITransactionStore dataSource, double repulsion)
 {
     _dataSource    = dataSource;
     _clusters      = new List <Cluster>();
     _tableClusters = new List <int>();
     _mathCache     = new MathCache(repulsion);
 }
Example #3
0
 /// <summary>
 /// Starts transaction.
 /// </summary>
 /// <param name="transactionStore">Transaction store.</param>
 /// <param name="aggregateStore">Aggregate store.</param>
 /// <param name="integrationEventStore">Integration events store.</param>
 /// <returns>Scope of the transaction.</returns>
 public ITransactionScope CreateTransactionalScope(
     ITransactionStore transactionStore,
     IAggregateStore aggregateStore,
     IIntegrationEventStore integrationEventStore)
 {
     return(CreateTransactionalScope(new TransactionScope(transactionStore, aggregateStore, integrationEventStore)));
 }
        public SynchronizationManager(
            IBlockTree blockTree,
            IBlockValidator blockValidator,
            IHeaderValidator headerValidator,
            ITransactionStore transactionStore,
            ITransactionValidator transactionValidator,
            ILogManager logManager,
            IBlockchainConfig blockchainConfig, IPerfService perfService)
        {
            _logger           = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
            _blockchainConfig = blockchainConfig ?? throw new ArgumentNullException(nameof(blockchainConfig));
            _perfService      = perfService;

            _transactionStore     = transactionStore ?? throw new ArgumentNullException(nameof(transactionStore));
            _transactionValidator = transactionValidator ?? throw new ArgumentNullException(nameof(transactionValidator));

            _blockTree       = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            _blockValidator  = blockValidator ?? throw new ArgumentNullException(nameof(blockValidator));
            _headerValidator = headerValidator ?? throw new ArgumentNullException(nameof(headerValidator));

            if (_logger.IsDebug)
            {
                _logger.Debug($"Initialized SynchronizationManager with head block {Head.ToString(BlockHeader.Format.Short)}");
            }

            _entireSyncStopWatch.Start();
        }
 public TransactionRepository(ITransactionStore store,
                              ICacheService cacheService,
                              IUserIdAccesor userIdAccesor,
                              ICacheOptions options)
     : base(store, cacheService, options)
 {
     _userIdAccesor = userIdAccesor;
 }
Example #6
0
        public async Task <IActionResult> Get(
            [FromQuery] TransactionQueryParameters parameters,
            [FromServices] ITransactionStore transactionStore)
        {
            var result = await transactionStore.GetAsync(parameters);

            return(this.PagedOk(result));
        }
 public TransactionSummaryBuilder(ITransactionStore transactionStore,
                                  IUsersStore usersStore,
                                  ITransactionsImporter transactionsImporter)
 {
     this.transactionStore     = transactionStore;
     this.usersStore           = usersStore;
     this.transactionsImporter = transactionsImporter;
 }
Example #8
0
 public void SetStore(ITransactionStore transactionStore)
 {
     _transactionStore = transactionStore;
     foreach (var component in components)
     {
         component.SetStore(transactionStore);
     }
 }
 public BlockchainBridge(IEthereumSigner signer, IStateProvider stateProvider, IKeyStore keyStore, IBlockTree blockTree, IDb db, ITransactionStore transactionStore)
 {
     _signer           = signer;
     _stateProvider    = stateProvider;
     _keyStore         = keyStore;
     _blockTree        = blockTree;
     _db               = db;
     _transactionStore = transactionStore;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TransactionScope"/> class.
 /// </summary>
 /// <param name="transactionStore">Transaction store.</param>
 /// <param name="aggregateStore">Aggregate store.</param>
 /// <param name="integrationEventStore">Integration events store.</param>
 public TransactionScope(
     ITransactionStore transactionStore,
     IAggregateStore aggregateStore,
     IIntegrationEventStore integrationEventStore)
 {
     this.aggregateStore        = aggregateStore;
     this.integrationEventStore = integrationEventStore;
     this.transactionStore      = transactionStore;
 }
Example #11
0
        public Display(int columnNumber, ITransactionStore dataSource, List <int> tableClusters)
        {
            this.dataSource    = dataSource;
            this.tableClusters = tableClusters;
            this.columnNumber  = columnNumber;

            classesIDs        = this.dataSource.GetClassesIDs(columnNumber);
            clusterOccurences = new List <Dictionary <UID, int> >();
        }
Example #12
0
        public void Setup()
        {
            console          = Substitute.For <IConsole>();
            clock            = Substitute.For <IClock>();
            transactionStore = new TransactionStore(clock);
            statementPrinter = new StatementPrinter(console);

            account = new Account(transactionStore, statementPrinter);
        }
Example #13
0
 public TransactionBufferController(IBufferedTransactionStore bufferedTransactionStore,
                                    ITransactionStore transactionStore, IVendorStore vendorStore, ITagStore tagStore,
                                    IImportTransactionsService importTransactionsService)
 {
     _bufferedTransactionStore = bufferedTransactionStore;
     _transactionStore         = transactionStore;
     _vendorStore = vendorStore;
     _tagStore    = tagStore;
     _importTransactionsService = importTransactionsService;
 }
Example #14
0
 public TransactionsImporter(ITransactionStore transactionsStore,
                             IBankDataProvider bankDataProvider,
                             IOptionsMonitor <DataImportOptions> dataImportOptions,
                             IClock clock,
                             IUsersStore usersStore)
 {
     this.transactionsStore = transactionsStore;
     this.bankDataProvider  = bankDataProvider;
     this.clock             = clock;
     this.usersStore        = usersStore;
     this.dataImportOptions = dataImportOptions.CurrentValue;
 }
        public TestTransactionsGenerator(ITransactionStore store, IEthereumSigner signer, TimeSpan txDelay, ILogManager logManager)
        {
            _logger  = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
            _store   = store ?? throw new ArgumentNullException(nameof(store));
            _signer  = signer ?? throw new ArgumentNullException(nameof(signer));
            _txDelay = txDelay;

            if (txDelay > TimeSpan.FromMilliseconds(0))
            {
                _timer.Elapsed += TimerOnElapsed;
                _timer.Interval = txDelay.TotalMilliseconds;
            }

            _privateKeyBytes[31] = 1;
            _privateKey          = new PrivateKey(_privateKeyBytes);
            SenderAddress        = _privateKey.PublicKey.Address;
            _logger.Debug($"Test transactions will be coming from {SenderAddress}.");
        }
Example #16
0
        public BlockchainProcessor(
            IBlockTree blockTree,
            ISealEngine sealEngine,
            ITransactionStore transactionStore,
            IDifficultyCalculator difficultyCalculator,
            IBlockProcessor blockProcessor,
            IEthereumSigner signer,
            ILogManager logManager)
        {
            _logger    = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
            _blockTree = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            _blockTree.NewBestSuggestedBlock += OnNewBestBlock;

            _transactionStore     = transactionStore ?? throw new ArgumentNullException(nameof(transactionStore));
            _difficultyCalculator = difficultyCalculator ?? throw new ArgumentNullException(nameof(difficultyCalculator));
            _sealEngine           = sealEngine ?? throw new ArgumentNullException(nameof(sealEngine));
            _blockProcessor       = blockProcessor ?? throw new ArgumentNullException(nameof(blockProcessor));
            _signer = signer ?? throw new ArgumentNullException(nameof(signer));
        }
Example #17
0
 public BlockProcessor(
     ISpecProvider specProvider,
     IBlockValidator blockValidator,
     IRewardCalculator rewardCalculator,
     ITransactionProcessor transactionProcessor,
     IDbProvider dbProvider,
     IStateProvider stateProvider,
     IStorageProvider storageProvider, ITransactionStore transactionStore, ILogManager logManager)
 {
     _logger               = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
     _specProvider         = specProvider ?? throw new ArgumentNullException(nameof(specProvider));
     _blockValidator       = blockValidator ?? throw new ArgumentNullException(nameof(blockValidator));;
     _stateProvider        = stateProvider ?? throw new ArgumentNullException(nameof(stateProvider));;
     _storageProvider      = storageProvider ?? throw new ArgumentNullException(nameof(storageProvider));;
     _transactionStore     = transactionStore ?? throw new ArgumentNullException(nameof(transactionStore));;
     _rewardCalculator     = rewardCalculator ?? throw new ArgumentNullException(nameof(rewardCalculator));;
     _transactionProcessor = transactionProcessor ?? throw new ArgumentNullException(nameof(transactionProcessor));;
     _dbProvider           = dbProvider;
 }
        public SynchronizationManager(
            IBlockTree blockTree,
            IBlockValidator blockValidator,
            IHeaderValidator headerValidator,
            ITransactionStore transactionStore,
            ITransactionValidator transactionValidator,
            ILogger logger, IBlockchainConfig blockchainConfig)
        {
            _logger               = logger ?? throw new ArgumentNullException(nameof(logger));
            _blockchainConfig     = blockchainConfig;
            _transactionStore     = transactionStore ?? throw new ArgumentNullException(nameof(transactionStore));
            _transactionValidator = transactionValidator ?? throw new ArgumentNullException(nameof(transactionValidator));

            BlockTree                     = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            _blockValidator               = blockValidator ?? throw new ArgumentNullException(nameof(blockValidator));
            _headerValidator              = headerValidator ?? throw new ArgumentNullException(nameof(headerValidator));
            BlockTree.NewHeadBlock       += OnNewHeadBlock;
            _transactionStore.NewPending += OnNewPendingTransaction;

            _logger.Info($"Initialized {nameof(SynchronizationManager)} with head block {Head.ToString(BlockHeader.Format.Short)}");
        }
Example #19
0
 public AccountService(ITransactionStore store, IStatementPrinter printer)
 {
     _store   = store ?? throw new ArgumentNullException(nameof(store));
     _printer = printer ?? throw new ArgumentNullException(nameof(printer));
 }
Example #20
0
 public Account(ITransactionStore transactionStore, IStatementPrinter statementPrinter)
 {
     _transactionStore = transactionStore;
     _statementPrinter = statementPrinter;
 }
Example #21
0
 public void Setup()
 {
     _transactionStore = Substitute.For <ITransactionStore>();
     _statementPrinter = Substitute.For <IStatementPrinter>();
     _account          = new Account(_transactionStore, _statementPrinter);
 }
Example #22
0
 public ReportsController(IReportsProvider reportsProvider, ITransactionStore transactionStore)
 {
     _reportsProvider  = reportsProvider;
     _transactionStore = transactionStore;
 }
Example #23
0
 public FileImporter(IFieldValidator fieldValidator, ITransactionStore transactionStore)
 {
     _fieldValidator = fieldValidator;
     _transactionStore = transactionStore;
 }
 public void SetStore(ITransactionStore transactionStore)
 {
     _transactionStore = transactionStore;
 }
Example #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TransactionManagerBehavior{TCommand}"/> class.
 /// </summary>
 /// <param name="transactionStore">Transaction store.</param>
 /// <param name="aggregateStore">Aggregate store.</param>
 /// <param name="integrationEventStore">Integration events store.</param>
 public TransactionManagerBehavior(ITransactionStore transactionStore, IAggregateStore aggregateStore, IIntegrationEventStore integrationEventStore)
 {
     this.transactionStore      = transactionStore;
     this.aggregateStore        = aggregateStore;
     this.integrationEventStore = integrationEventStore;
 }
Example #26
0
 public Account(ITransactionStore transactionStore, IStatementPrinter statementPrinter)
 {
     this.transactionStore = transactionStore;
     this.statementPrinter = statementPrinter;
 }
Example #27
0
 public TransactionsController(ITransactionStore transactionStore, IVendorStore vendorStore, ITagStore tagStore)
 {
     _transactionStore = transactionStore;
     _vendorStore      = vendorStore;
     _tagStore         = tagStore;
 }