public PersistenceStrategy( IBlockchainStoreRepositoryFactory repositoryFactory, FilterContainer filters, IWaitStrategy waitStrategy = null, int maxRetries = 3, long minimumBlockNumber = 0, int minimumBlockConfirmations = 6) { MinimumBlockNumber = minimumBlockNumber; MaxRetries = maxRetries; MinimumBlockConfirmations = minimumBlockConfirmations; Filters = filters; _waitStrategy = waitStrategy ?? new WaitStrategy(); _blockRepository = repositoryFactory.CreateBlockRepository(); _contractRepository = repositoryFactory.CreateContractRepository(); var transactionRepository = repositoryFactory.CreateTransactionRepository(); var addressTransactionRepository = repositoryFactory.CreateAddressTransactionRepository(); var logRepository = repositoryFactory.CreateTransactionLogRepository(); var vmStackRepository = repositoryFactory.CreateTransactionVmStackRepository(); _repositories.Add(_blockRepository); _repositories.Add(_contractRepository); _repositories.Add(transactionRepository); _repositories.Add(addressTransactionRepository); _repositories.Add(logRepository); _repositories.Add(vmStackRepository); BlockHandler = new BlockRepositoryHandler(_blockRepository); TransactionHandler = new TransactionRepositoryHandler(transactionRepository, addressTransactionRepository); ContractHandler = new ContractRepositoryHandler(_contractRepository); TransactionVmStackHandler = new TransactionVMStackRepositoryHandler(vmStackRepository); TransactionLogHandler = new TransactionLogRepositoryHandler(logRepository); _waitStrategy = new WaitStrategy(); }
public TransactionRepositoryHandlerTests() { _handler = new TransactionRepositoryHandler(_transactionRepository.Object, _addressTransactionRepository.Object); }