Esempio n. 1
0
        private void Initialize()
        {
            _transactionManager        = new TransactionManager(_dataStore, _logger);
            _transactionReceiptManager = new TransactionReceiptManager(_database);
            _smartContractManager      = new SmartContractManager(_dataStore);
            _transactionResultManager  = new TransactionResultManager(_dataStore);
            _transactionTraceManager   = new TransactionTraceManager(_dataStore);
            _functionMetadataService   = new FunctionMetadataService(_dataStore, _logger);
            _chainManagerBasic         = new ChainManagerBasic(_dataStore);
            _chainService = new ChainService(_chainManagerBasic, new BlockManagerBasic(_dataStore),
                                             _transactionManager, _transactionTraceManager, _dataStore, StateStore);
            _smartContractRunnerFactory = new SmartContractRunnerFactory();

            /*var runner = new SmartContractRunner("../../../../AElf.SDK.CSharp/bin/Debug/netstandard2.0/");
             * _smartContractRunnerFactory.AddRunner(0, runner);*/
            var runner = new SmartContractRunner(ContractCodes.TestContractFolder);

            _smartContractRunnerFactory.AddRunner(0, runner);
            _concurrencyExecutingService = new SimpleExecutingService(
                new SmartContractService(_smartContractManager, _smartContractRunnerFactory, StateStore,
                                         _functionMetadataService), _transactionTraceManager, StateStore,
                new ChainContextService(_chainService));

            _chainCreationService = new ChainCreationService(_chainService,
                                                             new SmartContractService(new SmartContractManager(_dataStore), _smartContractRunnerFactory,
                                                                                      StateStore, _functionMetadataService), _logger);

            _binaryMerkleTreeManager = new BinaryMerkleTreeManager(_dataStore);
            _chainContextService     = new ChainContextService(_chainService);
            _stateStore = new StateStore(_database);
        }
Esempio n. 2
0
        public TxHub(ITransactionManager transactionManager, ITransactionReceiptManager receiptManager,
                     IChainService chainService,
                     ITxSignatureVerifier signatureVerifier,
                     ITxRefBlockValidator refBlockValidator)
        {
            _transactionManager = transactionManager;
            _receiptManager     = receiptManager;
            _chainService       = chainService;
            _signatureVerifier  = signatureVerifier;
            _refBlockValidator  = refBlockValidator;

            _terminated = false;
        }
Esempio n. 3
0
 public TransactionReceiptManagerTests()
 {
     _transactionReceiptManager = GetRequiredService <TransactionReceiptManager>();
 }