Ejemplo n.º 1
0
        public virtual void Setup()
        {
            ILogManager logger = LimboLogs.Instance;;
            IDb         codeDb = new StateDb();

            _stateDb       = new StateDb();
            TestState      = new StateProvider(_stateDb, codeDb, logger);
            Storage        = new StorageProvider(_stateDb, TestState, logger);
            _ethereumEcdsa = new EthereumEcdsa(SpecProvider, logger);
            IBlockhashProvider blockhashProvider = new TestBlockhashProvider();

            Machine    = new VirtualMachine(TestState, Storage, blockhashProvider, SpecProvider, logger);
            _processor = new TransactionProcessor(SpecProvider, TestState, Storage, Machine, logger);
        }
Ejemplo n.º 2
0
        public VirtualMachineTestsBase()
        {
            ILogManager logger = LimboLogs.Instance;;
            IDb         codeDb = new StateDb();

            _stateDb = new StateDb();
            StateTree stateTree = new StateTree(_stateDb);

            TestState       = new StateProvider(stateTree, codeDb, logger);
            Storage         = new StorageProvider(_stateDb, TestState, logger);
            _ethereumSigner = new EthereumSigner(SpecProvider, logger);
            IBlockhashProvider blockhashProvider = new TestBlockhashProvider();
            IVirtualMachine    virtualMachine    = new VirtualMachine(TestState, Storage, blockhashProvider, logger);

            _processor = new TransactionProcessor(SpecProvider, TestState, Storage, virtualMachine, logger);
        }
Ejemplo n.º 3
0
        public VirtualMachineTests()
        {
            _spec = RopstenSpecProvider.Instance;
            ILogManager logger = NullLogManager.Instance;
            IDb         codeDb = new MemDb();

            _stateDb = new SnapshotableDb(new MemDb());
            StateTree stateTree = new StateTree(_stateDb);

            _stateProvider     = new StateProvider(stateTree, codeDb, logger);
            _storageDbProvider = new MemDbProvider(logger);
            _storageProvider   = new StorageProvider(_storageDbProvider, _stateProvider, logger);
            _ethereumSigner    = new EthereumSigner(_spec, logger);
            IBlockhashProvider blockhashProvider = new TestBlockhashProvider();
            IVirtualMachine    virtualMachine    = new VirtualMachine(_stateProvider, _storageProvider, blockhashProvider, logger);

            _processor = new TransactionProcessor(_spec, _stateProvider, _storageProvider, virtualMachine, this, logger);
        }