コード例 #1
0
ファイル: OSTestHelper.cs プロジェクト: zhoujue1110/AElf
        public OSTestHelper(IOsBlockchainNodeContextService osBlockchainNodeContextService,
                            IAccountService accountService,
                            IMinerService minerService,
                            IBlockchainService blockchainService,
                            ITxHub txHub,
                            ISmartContractAddressService smartContractAddressService,
                            IBlockAttachService blockAttachService,
                            IStaticChainInformationProvider staticChainInformationProvider,
                            ITransactionResultService transactionResultService,
                            IOptionsSnapshot <ChainOptions> chainOptions)
        {
            _chainOptions = chainOptions.Value;
            _osBlockchainNodeContextService = osBlockchainNodeContextService;
            _accountService              = accountService;
            _minerService                = minerService;
            _blockchainService           = blockchainService;
            _smartContractAddressService = smartContractAddressService;
            _blockAttachService          = blockAttachService;
            _txHub = txHub;
            _staticChainInformationProvider = staticChainInformationProvider;
            _transactionResultService       = transactionResultService;

            BestBranchBlockList     = new List <Block>();
            ForkBranchBlockList     = new List <Block>();
            UnlinkedBranchBlockList = new List <Block>();
        }
コード例 #2
0
 public BlockMiningEventHandler(IMinerService minerService, IBlockAttachService blockAttachService,
                                ITaskQueueManager taskQueueManager)
 {
     _minerService       = minerService;
     _blockAttachService = blockAttachService;
     _taskQueueManager   = taskQueueManager;
     Logger = NullLogger <BlockMiningEventHandler> .Instance;
 }
コード例 #3
0
ファイル: ContractBasicTests.cs プロジェクト: solnex/AElf-1
 public ContractBasicTests()
 {
     _blockchainService        = GetRequiredService <IBlockchainService>();
     _miningService            = GetRequiredService <IMiningService>();
     _blockAttachService       = GetRequiredService <IBlockAttachService>();
     _transactionResultManager = GetRequiredService <ITransactionResultManager>();
     InitializeTestContracts();
 }
コード例 #4
0
 public ContractTestService(IContractTesterFactory contractTesterFactory, IBlockchainService blockchainService,
                            IMiningService miningService, IBlockAttachService blockAttachService)
 {
     _contractTesterFactory = contractTesterFactory;
     _blockchainService     = blockchainService;
     _miningService         = miningService;
     _blockAttachService    = blockAttachService;
 }
コード例 #5
0
 public BlockAttachServiceTests()
 {
     _blockAttachService           = GetRequiredService <IBlockAttachService>();
     _smartContractExecutionHelper = GetRequiredService <SmartContractExecutionHelper>();
     _kernelTestHelper             = GetRequiredService <KernelTestHelper>();
     _blockchainService            = GetRequiredService <IBlockchainService>();
     _blockExecutingService        = GetRequiredService <IBlockExecutingService>();
     _smartContractAddressService  = GetRequiredService <ISmartContractAddressService>();
 }
コード例 #6
0
 public ConsensusRequestMiningEventHandler(IMinerService minerService, IBlockAttachService blockAttachService,
                                           ITaskQueueManager taskQueueManager, IBlockchainService blockchainService)
 {
     _minerService       = minerService;
     _blockAttachService = blockAttachService;
     _taskQueueManager   = taskQueueManager;
     _blockchainService  = blockchainService;
     Logger        = NullLogger <ConsensusRequestMiningEventHandler> .Instance;
     LocalEventBus = NullLocalEventBus.Instance;
 }
コード例 #7
0
        public ConsensusRequestMiningEventHandler(IServiceProvider serviceProvider)
        {
            _minerService       = serviceProvider.GetService <IMinerService>();
            _blockAttachService = serviceProvider.GetService <IBlockAttachService>();
            _taskQueueManager   = serviceProvider.GetService <ITaskQueueManager>();
            _blockchainService  = serviceProvider.GetService <IBlockchainService>();
            _consensusService   = serviceProvider.GetService <IConsensusService>();

            Logger        = NullLogger <ConsensusRequestMiningEventHandler> .Instance;
            LocalEventBus = NullLocalEventBus.Instance;
        }
コード例 #8
0
        public BlockSyncAttachService(IBlockchainService blockchainService,
                                      IBlockAttachService blockAttachService,
                                      IBlockValidationService validationService,
                                      IBlockSyncQueueService blockSyncQueueService)
        {
            Logger = NullLogger <BlockSyncAttachService> .Instance;

            _blockchainService     = blockchainService;
            _blockAttachService    = blockAttachService;
            _validationService     = validationService;
            _blockSyncQueueService = blockSyncQueueService;
        }
コード例 #9
0
        public async Task GlobalSetup()
        {
            _chains             = GetRequiredService <IBlockchainStore <Chain> >();
            _blockStateSets     = GetRequiredService <INotModifiedCachedStateStore <BlockStateSet> >();
            _chainManager       = GetRequiredService <IChainManager>();
            _blockManager       = GetRequiredService <IBlockManager>();
            _blockchainService  = GetRequiredService <IBlockchainService>();
            _blockAttachService = GetRequiredService <IBlockAttachService>();
            _transactionManager = GetRequiredService <ITransactionManager>();
            _osTestHelper       = GetRequiredService <OSTestHelper>();

            _chain = await _blockchainService.GetChainAsync();
        }
コード例 #10
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>();
 }
コード例 #11
0
        public BlockSyncAttachService(IBlockchainService blockchainService,
                                      IBlockAttachService blockAttachService,
                                      IBlockSyncValidationService blockSyncValidationService,
                                      IBlockSyncQueueService blockSyncQueueService)
        {
            Logger        = NullLogger <BlockSyncAttachService> .Instance;
            LocalEventBus = NullLocalEventBus.Instance;

            _blockchainService          = blockchainService;
            _blockAttachService         = blockAttachService;
            _blockSyncValidationService = blockSyncValidationService;
            _blockSyncQueueService      = blockSyncQueueService;
        }
コード例 #12
0
ファイル: ParallelTests.cs プロジェクト: zhxymh/AElf
 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>();
 }
コード例 #13
0
        public BlockSyncJob(IBlockAttachService blockAttachService,
                            IOptionsSnapshot <NetworkOptions> networkOptions,
                            IBlockchainService blockchainService,
                            INetworkService networkService,
                            ITaskQueueManager taskQueueManager)
        {
            Logger          = NullLogger <BlockSyncJob> .Instance;
            _networkOptions = networkOptions.Value;

            _blockchainService  = blockchainService;
            _networkService     = networkService;
            _blockAttachService = blockAttachService;
            _taskQueueManager   = taskQueueManager;
        }
コード例 #14
0
 public ParallelTestHelper(IOsBlockchainNodeContextService osBlockchainNodeContextService,
                           IAccountService accountService,
                           IMinerService minerService,
                           IBlockchainService blockchainService,
                           ITxHub txHub,
                           ISmartContractAddressService smartContractAddressService,
                           IBlockAttachService blockAttachService,
                           IStaticChainInformationProvider staticChainInformationProvider,
                           ITransactionResultService transactionResultService,
                           IOptionsSnapshot <ChainOptions> chainOptions) : base(osBlockchainNodeContextService, accountService,
                                                                                minerService, blockchainService, txHub, smartContractAddressService, blockAttachService,
                                                                                staticChainInformationProvider, transactionResultService, chainOptions)
 {
     _accountService = accountService;
     _staticChainInformationProvider = staticChainInformationProvider;
 }
コード例 #15
0
ファイル: ParallelTests.cs プロジェクト: zhoujue1110/AElf
 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>();
 }
コード例 #16
0
        public void Setup(BenchmarkContext context)
        {
            _blockchainService  = GetRequiredService <IBlockchainService>();
            _osTestHelper       = GetRequiredService <OSTestHelper>();
            _minerService       = GetRequiredService <IMinerService>();
            _txHub              = GetRequiredService <ITxHub>();
            _blockAttachService = GetRequiredService <IBlockAttachService>();

            _counter = context.GetCounter("TestCounter");

            AsyncHelper.RunSync(async() =>
            {
                var transactions = await _osTestHelper.GenerateTransferTransactions(1000);

                await _osTestHelper.BroadcastTransactions(transactions);
            });
        }
コード例 #17
0
ファイル: BlockAttachTests.cs プロジェクト: xiaoxiongnpu/AElf
        public void Setup(BenchmarkContext context)
        {
            _blockchainService  = GetRequiredService <IBlockchainService>();
            _blockAttachService = GetRequiredService <IBlockAttachService>();
            _osTestHelper       = GetRequiredService <OSTestHelper>();

            _counter = context.GetCounter("TestCounter");

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

                var transactions = await _osTestHelper.GenerateTransferTransactions(1000);

                _block = _osTestHelper.GenerateBlock(chain.BestChainHash, chain.BestChainHeight, transactions);
            });
        }