public BlockSyncAttachServiceTests()
 {
     _blockSyncAttachService = GetRequiredService <IBlockSyncAttachService>();
     _blockchainService      = GetRequiredService <IBlockchainService>();
     _blockExecutingService  = GetRequiredService <IBlockExecutingService>();
     _osTestHelper           = GetRequiredService <OSTestHelper>();
 }
Exemplo n.º 2
0
        public void Setup(BenchmarkContext context)
        {
            _blockchainService     = GetRequiredService <IBlockchainService>();
            _blockExecutingService = GetRequiredService <IBlockExecutingService>();
            _osTestHelper          = GetRequiredService <OSTestHelper>();

            _counter = context.GetCounter("TestCounter");

            AsyncHelper.RunSync(async() =>
            {
                var chain = await _blockchainService.GetChainAsync();

                _block = new Block
                {
                    Header = new BlockHeader
                    {
                        ChainId           = chain.Id,
                        Height            = chain.BestChainHeight + 1,
                        PreviousBlockHash = chain.BestChainHash,
                        Time = Timestamp.FromDateTime(DateTime.UtcNow)
                    },
                    Body = new BlockBody()
                };

                _transactions = await _osTestHelper.GenerateTransferTransactions(1000);
            });
        }
 public void GlobalSetup()
 {
     _blockchainService     = GetRequiredService <IBlockchainService>();
     _blockExecutingService = GetRequiredService <IBlockExecutingService>();
     _blockStateSets        = GetRequiredService <INotModifiedCachedStateStore <BlockStateSet> >();
     _osTestHelper          = GetRequiredService <OSTestHelper>();
 }
Exemplo n.º 4
0
 public async Task GlobalSetup()
 {
     _blockchainService        = GetRequiredService <IBlockchainService>();
     _blockExecutingService    = GetRequiredService <IBlockExecutingService>();
     _transactionResultManager = GetRequiredService <ITransactionResultManager>();
     _blockStateSets           = GetRequiredService <INotModifiedCachedStateStore <BlockStateSet> >();
     _osTestHelper             = GetRequiredService <OSTestHelper>();
 }
Exemplo n.º 5
0
 public ChainCreationService(IBlockchainService blockchainService, IBlockExecutingService blockExecutingService,
                             IBlockchainExecutingService blockchainExecutingService)
 {
     _blockchainService          = blockchainService;
     _blockExecutingService      = blockExecutingService;
     _blockchainExecutingService = blockchainExecutingService;
     Logger        = NullLogger <ChainCreationService> .Instance;
     LocalEventBus = NullLocalEventBus.Instance;
 }
Exemplo n.º 6
0
 public BlockAttachServiceTests()
 {
     _blockAttachService           = GetRequiredService <IBlockAttachService>();
     _smartContractExecutionHelper = GetRequiredService <SmartContractExecutionHelper>();
     _kernelTestHelper             = GetRequiredService <KernelTestHelper>();
     _blockchainService            = GetRequiredService <IBlockchainService>();
     _blockExecutingService        = GetRequiredService <IBlockExecutingService>();
     _smartContractAddressService  = GetRequiredService <ISmartContractAddressService>();
 }
Exemplo n.º 7
0
 public FullBlockchainExecutingServiceTests()
 {
     _fullBlockchainExecutingService = GetRequiredService <FullBlockchainExecutingService>();
     _blockchainService            = GetRequiredService <IBlockchainService>();
     _kernelTestHelper             = GetRequiredService <KernelTestHelper>();
     _smartContractExecutionHelper = GetRequiredService <SmartContractExecutionHelper>();
     _blockExecutingService        = GetRequiredService <IBlockExecutingService>();
     _smartContractAddressService  = GetRequiredService <ISmartContractAddressService>();
     _blockStateSetManger          = GetRequiredService <IBlockStateSetManger>();
 }
Exemplo n.º 8
0
        public FullBlockchainExecutingService(IChainManager chainManager,
                                              IBlockchainService blockchainService, IBlockValidationService blockValidationService,
                                              IBlockExecutingService blockExecutingService, IBlockchainStateManager blockchainStateManager)
        {
            _chainManager           = chainManager;
            _blockchainService      = blockchainService;
            _blockValidationService = blockValidationService;
            _blockExecutingService  = blockExecutingService;
            _blockchainStateManager = blockchainStateManager;

            LocalEventBus = NullLocalEventBus.Instance;
        }
 public SmartContractExecutionHelper(IBlockExecutingService blockExecutingService,
                                     IBlockchainService blockchainService, IBlockchainExecutingService blockchainExecutingService,
                                     IBlockExecutionResultProcessingService blockExecutionResultProcessingService,
                                     IDefaultContractZeroCodeProvider defaultContractZeroCodeProvider)
 {
     _blockExecutingService                 = blockExecutingService;
     _blockchainService                     = blockchainService;
     _blockchainExecutingService            = blockchainExecutingService;
     _blockExecutionResultProcessingService = blockExecutionResultProcessingService;
     _defaultContractZeroCodeProvider       = defaultContractZeroCodeProvider;
     ContractCodes = ContractsDeployer.GetContractCodes <SmartContractExecutionTestAElfModule>();
 }
Exemplo n.º 10
0
 public MiningService(IAccountService accountService,
                      IBlockGenerationService blockGenerationService,
                      ISystemTransactionGenerationService systemTransactionGenerationService,
                      IBlockExecutingService blockExecutingService)
 {
     Logger = NullLogger <MiningService> .Instance;
     _blockGenerationService             = blockGenerationService;
     _systemTransactionGenerationService = systemTransactionGenerationService;
     _blockExecutingService = blockExecutingService;
     _accountService        = accountService;
     EventBus = NullLocalEventBus.Instance;
 }
Exemplo n.º 11
0
 public ParallelTests()
 {
     _blockchainService        = GetRequiredService <IBlockchainService>();
     _blockExecutingService    = GetRequiredService <IBlockExecutingService>();
     _transactionResultManager = GetRequiredService <ITransactionResultManager>();
     _grouper = GetRequiredService <ITransactionGrouper>();
     _contractRemarksService = GetRequiredService <IContractRemarksService>();
     _txHub = GetRequiredService <ITxHub>();
     _blockAttachService          = GetRequiredService <IBlockAttachService>();
     _accountService              = GetRequiredService <IAccountService>();
     _parallelTestHelper          = GetRequiredService <ParallelTestHelper>();
     _smartContractAddressService = GetRequiredService <ISmartContractAddressService>();
 }
        public void GlobalSetup()
        {
            _blockchainService     = GetRequiredService <IBlockchainService>();
            _blockExecutingService = GetRequiredService <IBlockExecutingService>();
            _minerService          = GetRequiredService <IMinerService>();
            _blockStateSets        = GetRequiredService <INotModifiedCachedStateStore <BlockStateSet> >();
            _osTestHelper          = GetRequiredService <OSTestHelper>();

            _prepareTransactions     = new List <Transaction>();
            _systemTransactions      = new List <Transaction>();
            _cancellableTransactions = new List <Transaction>();
            _keyPairs = new List <ECKeyPair>();
        }
Exemplo n.º 13
0
 public ParallelTests()
 {
     _blockchainService        = GetRequiredService <IBlockchainService>();
     _blockExecutingService    = GetRequiredService <IBlockExecutingService>();
     _minerService             = GetRequiredService <IMinerService>();
     _transactionResultManager = GetRequiredService <ITransactionResultManager>();
     _grouper            = GetRequiredService <ITransactionGrouper>();
     _codeRemarksManager = GetRequiredService <ICodeRemarksManager>();
     _txHub = GetRequiredService <ITxHub>();
     _blockAttachService = GetRequiredService <IBlockAttachService>();
     _accountService     = GetRequiredService <IAccountService>();
     _parallelTestHelper = GetRequiredService <ParallelTestHelper>();
 }
        public FullBlockchainExecutingService(IBlockchainService blockchainService,
                                              IBlockValidationService blockValidationService,
                                              IBlockExecutingService blockExecutingService,
                                              ITransactionResultService transactionResultService, IBlockStateSetManger blockStateSetManger)
        {
            _blockchainService        = blockchainService;
            _blockValidationService   = blockValidationService;
            _blockExecutingService    = blockExecutingService;
            _transactionResultService = transactionResultService;
            _blockStateSetManger      = blockStateSetManger;

            LocalEventBus = NullLocalEventBus.Instance;
        }
Exemplo n.º 15
0
        public void Setup(BenchmarkContext context)
        {
            _blockchainService     = GetRequiredService <IBlockchainService>();
            _blockExecutingService = GetRequiredService <IBlockExecutingService>();
            _osTestHelper          = GetRequiredService <OSTestHelper>();

            _counter = context.GetCounter("TestCounter");

            AsyncHelper.RunSync(async() =>
            {
                var chain     = await _blockchainService.GetChainAsync();
                _transactions = await _osTestHelper.GenerateTransferTransactions(1000);
                _block        = _osTestHelper.GenerateBlock(chain.BestChainHash, chain.BestChainHeight, _transactions);
            });
        }
Exemplo n.º 16
0
 public ParallelTests()
 {
     _blockchainService        = GetRequiredService <IBlockchainService>();
     _blockExecutingService    = GetRequiredService <IBlockExecutingService>();
     _transactionResultManager = GetRequiredService <ITransactionResultManager>();
     _grouper = GetRequiredService <ITransactionGrouper>();
     _blockchainStateService = GetRequiredService <IBlockchainStateService>();
     _txHub = GetRequiredService <ITxHub>();
     _blockAttachService              = GetRequiredService <IBlockAttachService>();
     _accountService                  = GetRequiredService <IAccountService>();
     _parallelTestHelper              = GetRequiredService <ParallelTestHelper>();
     _smartContractAddressService     = GetRequiredService <ISmartContractAddressService>();
     _blockchainStateManager          = GetRequiredService <IBlockchainStateManager>();
     _versionedStates                 = GetRequiredService <IStateStore <VersionedState> >();
     _nonparallelContractCodeProvider = GetRequiredService <INonparallelContractCodeProvider>();
     _blockStateSetManger             = GetRequiredService <IBlockStateSetManger>();
 }