public SmartContractEmulator(byte[] bytecodes)
        {
            Blockchain = new Blockchain();
            Emulator   = new NeoEmulator(Blockchain)
            {
                checkWitnessMode = CheckWitnessMode.AlwaysTrue
            };

            ContractAddress = Blockchain.DeployContract(string.Empty, bytecodes);
            Emulator.SetExecutingAddress(ContractAddress);
        }
Beispiel #2
0
        public void Setup()
        {
            var path = TestContext.CurrentContext.TestDirectory.Replace("ICO-Unit-Tests", "ICO-Template");

            Directory.SetCurrentDirectory(path);
            var avmBytes = File.ReadAllBytes("ICOContract.avm");
            var chain    = new Blockchain();

            emulator = new NeoEmulator(chain);
            var address = chain.DeployContract("test", avmBytes);

            emulator.SetExecutingAddress(address);
        }