public ReflectionVirtualMachineTests()
        {
            // Take what's needed for these tests
            var context = new ContractExecutorTestContext();

            this.network       = context.Network;
            this.vm            = context.Vm;
            this.state         = context.State;
            this.contractState = new SmartContractState(
                new Block(1, TestAddress),
                new Message(TestAddress, TestAddress, 0),
                new PersistentState(new PersistenceStrategy(this.state),
                                    context.ContractPrimitiveSerializer, TestAddress.ToUint160(this.network)),
                context.ContractPrimitiveSerializer,
                new GasMeter((Gas)5000000),
                new ContractLogHolder(this.network),
                Mock.Of <IInternalTransactionExecutor>(),
                new InternalHashHelper(),
                () => 1000);
        }
Esempio n. 2
0
 public ReflectionVirtualMachineTests()
 {
     // Take what's needed for these tests
     this.context       = new ContractExecutorTestContext();
     this.network       = this.context.Network;
     this.TestAddress   = "0x0000000000000000000000000000000000000001".HexToAddress();
     this.vm            = this.context.Vm;
     this.state         = this.context.State;
     this.contractState = new SmartContractState(
         new Block(1, this.TestAddress),
         new Message(this.TestAddress, this.TestAddress, 0),
         new PersistentState(
             new TestPersistenceStrategy(this.state),
             this.context.Serializer, this.TestAddress.ToUint160()),
         this.context.Serializer,
         new ContractLogHolder(),
         Mock.Of <IInternalTransactionExecutor>(),
         new InternalHashHelper(),
         () => 1000);
     this.gasMeter = new GasMeter((RuntimeObserver.Gas) 50_000);
 }
Esempio n. 3
0
        public GasInjectorTests()
        {
            // Only take from context what these tests require.
            var context = new ContractExecutorTestContext();

            this.vm             = context.Vm;
            this.repository     = context.State;
            this.network        = context.Network;
            this.moduleReader   = new ContractModuleDefinitionReader();
            this.assemblyLoader = new ContractAssemblyLoader();
            this.gasMeter       = new GasMeter((Gas)5000000);
            this.state          = new SmartContractState(
                new Block(1, TestAddress),
                new Message(TestAddress, TestAddress, 0),
                new PersistentState(new MeteredPersistenceStrategy(this.repository, this.gasMeter, new BasicKeyEncodingStrategy()),
                                    context.ContractPrimitiveSerializer, TestAddress.ToUint160(this.network)),
                context.ContractPrimitiveSerializer,
                this.gasMeter,
                new ContractLogHolder(this.network),
                Mock.Of <IInternalTransactionExecutor>(),
                new InternalHashHelper(),
                () => 1000);
        }