public SmartContractService(ISmartContractManager smartContractManager, ISmartContractRunnerFactory smartContractRunnerFactory, IStateStore stateStore, IFunctionMetadataService functionMetadataService) { _smartContractManager = smartContractManager; _smartContractRunnerFactory = smartContractRunnerFactory; _stateStore = stateStore; _functionMetadataService = functionMetadataService; }
public SmartContractService( ISmartContractRunnerContainer smartContractRunnerContainer, IFunctionMetadataService functionMetadataService, IBlockchainService chainService, ISmartContractAddressService smartContractAddressService, ISmartContractExecutiveService smartContractExecutiveService) { _smartContractRunnerContainer = smartContractRunnerContainer; _functionMetadataService = functionMetadataService; _chainService = chainService; _smartContractAddressService = smartContractAddressService; _smartContractExecutiveService = smartContractExecutiveService; }
public ContractTest(IStateStore stateStore, IChainCreationService chainCreationService, IChainService chainService, ITransactionManager transactionManager, ISmartContractManager smartContractManager, IChainContextService chainContextService, IFunctionMetadataService functionMetadataService, ISmartContractRunnerFactory smartContractRunnerFactory) { _stateStore = stateStore; _chainCreationService = chainCreationService; _chainService = chainService; _transactionManager = transactionManager; _smartContractManager = smartContractManager; _chainContextService = chainContextService; _functionMetadataService = functionMetadataService; _smartContractRunnerFactory = smartContractRunnerFactory; _smartContractService = new SmartContractService(_smartContractManager, _smartContractRunnerFactory, stateStore, _functionMetadataService); }
public MockSetup(IStateStore stateStore, IChainCreationService chainCreationService, IDataStore dataStore, IFunctionMetadataService functionMetadataService, ISmartContractRunnerFactory smartContractRunnerFactory) { StateStore = stateStore; _chainCreationService = chainCreationService; _functionMetadataService = functionMetadataService; _smartContractRunnerFactory = smartContractRunnerFactory; _smartContractManager = new SmartContractManager(dataStore); Task.Factory.StartNew(async() => { await Init(); }).Unwrap().Wait(); SmartContractService = new SmartContractService(_smartContractManager, _smartContractRunnerFactory, stateStore, _functionMetadataService); Task.Factory.StartNew(async() => { await DeploySampleContracts(); }).Unwrap().Wait(); }
public MockSetup(IDataStore dataStore, IChainCreationService chainCreationService, IChainService chainService, IActorEnvironment actorEnvironment, IChainContextService chainContextService, IFunctionMetadataService functionMetadataService, ISmartContractRunnerFactory smartContractRunnerFactory, ILogger logger, IStateStore stateStore, HashManager hashManager, TransactionManager transactionManager) { _logger = logger; _stateStore = stateStore; ActorEnvironment = actorEnvironment; if (!ActorEnvironment.Initialized) { ActorEnvironment.InitActorSystem(); } _hashManager = hashManager; _transactionManager = transactionManager; _chainCreationService = chainCreationService; _chainService = chainService; ChainContextService = chainContextService; _functionMetadataService = functionMetadataService; _smartContractRunnerFactory = smartContractRunnerFactory; SmartContractManager = new SmartContractManager(dataStore); Task.Factory.StartNew(async() => { await Init(); }).Unwrap().Wait(); SmartContractService = new SmartContractService(SmartContractManager, _smartContractRunnerFactory, stateStore, functionMetadataService); Task.Factory.StartNew(async() => { await DeploySampleContracts(); }).Unwrap().Wait(); ServicePack = new ServicePack() { ChainContextService = chainContextService, SmartContractService = SmartContractService, ResourceDetectionService = new NewMockResourceUsageDetectionService(), StateStore = _stateStore }; // These are only required for workertest // other tests use ActorEnvironment var workers = new[] { "/user/worker1", "/user/worker2" }; Worker1 = Sys.ActorOf(Props.Create <Worker>(), "worker1"); Worker2 = Sys.ActorOf(Props.Create <Worker>(), "worker2"); Router = Sys.ActorOf(Props.Empty.WithRouter(new TrackedGroup(workers)), "router"); Worker1.Tell(new LocalSerivcePack(ServicePack)); Worker2.Tell(new LocalSerivcePack(ServicePack)); Requestor = Sys.ActorOf(AElf.Execution.Execution.Requestor.Props(Router)); }
public MockSetup(IStateStore stateStore, IChainCreationService chainCreationService, IDataStore dataStore, IChainContextService chainContextService, IFunctionMetadataService functionMetadataService, ISmartContractRunnerFactory smartContractRunnerFactory) { StateStore = stateStore; _chainCreationService = chainCreationService; ChainContextService = chainContextService; _functionMetadataService = functionMetadataService; _smartContractRunnerFactory = smartContractRunnerFactory; SmartContractManager = new SmartContractManager(dataStore); Task.Factory.StartNew(async() => { await Init(); }).Unwrap().Wait(); SmartContractService = new SmartContractService(SmartContractManager, _smartContractRunnerFactory, stateStore, _functionMetadataService); ServicePack = new ServicePack() { ChainContextService = chainContextService, SmartContractService = SmartContractService, ResourceDetectionService = null, StateStore = StateStore }; }
public BlockChainTests_MockSetup(IDataStore dataStore, IChainCreationService chainCreationService, IChainService chainService, IChainContextService chainContextService, IFunctionMetadataService functionMetadataService, ISmartContractRunnerFactory smartContractRunnerFactory, ILogger logger, IStateStore stateStore, HashManager hashManager, TransactionManager transactionManager) { _logger = logger; _stateStore = stateStore; _hashManager = hashManager; _transactionManager = transactionManager; _chainCreationService = chainCreationService; ChainService = chainService; ChainContextService = chainContextService; _functionMetadataService = functionMetadataService; _smartContractRunnerFactory = smartContractRunnerFactory; SmartContractManager = new SmartContractManager(dataStore); Task.Factory.StartNew(async() => { await Init(); }).Unwrap().Wait(); SmartContractService = new SmartContractService(SmartContractManager, _smartContractRunnerFactory, stateStore, functionMetadataService); Task.Factory.StartNew(async() => { await DeploySampleContracts(); }).Unwrap().Wait(); }
public ResourceUsageDetectionService(IFunctionMetadataService functionMetadataService) { _functionMetadataService = functionMetadataService; }
public ResourceUsageDetectionServiceTest(IDataStore dataStore, IFunctionMetadataService functionMetadataService) { _dataStore = dataStore; _functionMetadataService = functionMetadataService; }
public FunctionMetadataServiceTest(IFunctionMetadataService functionMetadataService, IDataStore dataStore, ISmartContractRunnerFactory smartContractRunnerFactory) { _functionMetadataService = functionMetadataService; _dataStore = dataStore; _smartContractRunnerFactory = smartContractRunnerFactory; }
public ChainFunctionMetadataTest(IDataStore templateStore, ISmartContractRunnerFactory smartContractRunnerFactory, IFunctionMetadataService functionMetadataService) { _dataStore = templateStore ?? throw new ArgumentNullException(nameof(templateStore)); _smartContractRunnerFactory = smartContractRunnerFactory ?? throw new ArgumentException(nameof(smartContractRunnerFactory)); _functionMetadataService = functionMetadataService ?? throw new ArgumentException(nameof(functionMetadataService)); }