public BlockGenerationService(IBlockExtraDataService blockExtraDataService, IStaticChainInformationProvider staticChainInformationProvider, IBlockchainStateManager blockchainStateManager) { _blockExtraDataService = blockExtraDataService; _staticChainInformationProvider = staticChainInformationProvider; _blockchainStateManager = blockchainStateManager; }
public BlockchainStateService(IBlockchainService blockchainService, IBlockchainStateManager blockchainStateManager) { _blockchainService = blockchainService; _blockchainStateManager = blockchainStateManager; Logger = NullLogger <BlockchainStateService> .Instance; }
public async Task GlobalSetup() { _chains = GetRequiredService <IBlockchainStore <Chain> >(); _chainStateInfoCollection = GetRequiredService <IStateStore <ChainStateInfo> >(); _blockchainStateManager = GetRequiredService <IBlockchainStateManager>(); _blockchainStateService = GetRequiredService <IBlockchainStateService>(); _blockchainService = GetRequiredService <IBlockchainService>(); _osTestHelper = GetRequiredService <OSTestHelper>(); _chainManager = GetRequiredService <IChainManager>(); _blockManager = GetRequiredService <IBlockManager>(); _transactionManager = GetRequiredService <ITransactionManager>(); _transactionResultManager = GetRequiredService <ITransactionResultManager>(); _txHub = GetRequiredService <ITxHub>(); _blockStateSets = new List <BlockStateSet>(); _blocks = new List <Block>(); _chain = await _blockchainService.GetChainAsync(); var blockHash = _chain.BestChainHash; while (true) { var blockState = await _blockchainStateManager.GetBlockStateSetAsync(blockHash); _blockStateSets.Add(blockState); var blockHeader = await _blockchainService.GetBlockHeaderByHashAsync(blockHash); blockHash = blockHeader.PreviousBlockHash; if (blockHash == _chain.LastIrreversibleBlockHash) { break; } } await _blockchainStateService.MergeBlockStateAsync(_chain.BestChainHeight, _chain.BestChainHash); for (var i = 0; i < BlockCount; i++) { var transactions = await _osTestHelper.GenerateTransferTransactions(TransactionCount); await _osTestHelper.BroadcastTransactions(transactions); var block = await _osTestHelper.MinedOneBlock(); _blocks.Add(block); var blockState = await _blockchainStateManager.GetBlockStateSetAsync(block.GetHash()); _blockStateSets.Add(blockState); } var chain = await _blockchainService.GetChainAsync(); await _chainManager.SetIrreversibleBlockAsync(chain, chain.BestChainHash); _chainStateInfo = await _chainStateInfoCollection.GetAsync(chain.Id.ToStorageKey()); }
public TestingSmartContractExecutiveService(ISmartContractRunnerContainer smartContractRunnerContainer, IBlockchainStateManager blockchainStateManager, IDefaultContractZeroCodeProvider defaultContractZeroCodeProvider, IHostSmartContractBridgeContextService hostSmartContractBridgeContextService) : base( smartContractRunnerContainer, blockchainStateManager, defaultContractZeroCodeProvider, hostSmartContractBridgeContextService) { }
public SmartContractBridgeService(ISmartContractService smartContractService, IBlockchainService blockchainService, ISmartContractAddressService smartContractAddressService, IBlockchainStateManager blockchainStateManager) { _smartContractService = smartContractService; _blockchainService = blockchainService; _smartContractAddressService = smartContractAddressService; _blockchainStateManager = blockchainStateManager; Logger = NullLogger <SmartContractBridgeService> .Instance; }
public BlockChainAppServiceTest(ITestOutputHelper outputHelper) : base(outputHelper) { _blockchainService = GetRequiredService <IBlockchainService>(); _smartContractAddressService = GetRequiredService <ISmartContractAddressService>(); _txHub = GetRequiredService <ITxHub>(); _blockchainStateMergingService = GetRequiredService <IBlockchainStateMergingService>(); _blockchainStateManager = GetRequiredService <IBlockchainStateManager>(); _osTestHelper = GetRequiredService <OSTestHelper>(); _accountService = GetRequiredService <IAccountService>(); }
public SmartContractExecutiveService( ISmartContractRunnerContainer smartContractRunnerContainer, IBlockchainStateManager blockchainStateManager, IDefaultContractZeroCodeProvider defaultContractZeroCodeProvider, IHostSmartContractBridgeContextService hostSmartContractBridgeContextService) { _smartContractRunnerContainer = smartContractRunnerContainer; _blockchainStateManager = blockchainStateManager; _defaultContractZeroCodeProvider = defaultContractZeroCodeProvider; _hostSmartContractBridgeContextService = hostSmartContractBridgeContextService; _readOnlyContractInfoCache = new ReadOnlyDictionary <Address, long>(_contractInfoCache); }
public BlockChainAppService(IBlockchainService blockchainService, ITxHub txHub, IBlockchainStateManager blockchainStateManager) { _blockchainService = blockchainService; _txHub = txHub; _blockchainStateManager = blockchainStateManager; Logger = NullLogger <BlockChainAppService> .Instance; LocalEventBus = NullLocalEventBus.Instance; }
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 BlockchainStateManagerTests() { _blockStateSetManger = GetRequiredService <IBlockStateSetManger>(); _blockchainStateManager = GetRequiredService <IBlockchainStateManager>(); _tv = new List <TestPair>(); for (var i = 0; i < 200; i++) { _tv.Add(new TestPair() { BlockHash = Hash.FromRawBytes(new[] { Convert.ToByte(i) }), BlockHeight = i, Key = $"key{i}", Value = ByteString.CopyFromUtf8($"value{i}") }); } }
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>(); }
public BlockChainAppService(IBlockchainService blockchainService, ISmartContractAddressService smartContractAddressService, ITransactionReadOnlyExecutionService transactionReadOnlyExecutionService, ITransactionManager transactionManager, ITransactionResultQueryService transactionResultQueryService, ITxHub txHub, IBlockchainStateManager blockchainStateManager ) { _blockchainService = blockchainService; _smartContractAddressService = smartContractAddressService; _transactionReadOnlyExecutionService = transactionReadOnlyExecutionService; _transactionManager = transactionManager; _transactionResultQueryService = transactionResultQueryService; _txHub = txHub; _blockchainStateManager = blockchainStateManager; Logger = NullLogger <BlockChainAppService> .Instance; LocalEventBus = NullLocalEventBus.Instance; }
public BlockchainStateMergingServiceTests() { _blockchainStateManager = GetRequiredService <IBlockchainStateManager>(); _blockchainStateMergingService = GetRequiredService <IBlockchainStateMergingService>(); }
public StateProviderFactory(IBlockchainStateManager blockchainStateManager) { _blockchainStateManager = blockchainStateManager; }