コード例 #1
0
        public void Things_are_cold_to_start_with()
        {
            EvmState    evmState    = CreateEvmState();
            StorageCell storageCell = new(TestItem.AddressA, 1);

            evmState.IsCold(TestItem.AddressA).Should().BeTrue();
            evmState.IsCold(storageCell).Should().BeTrue();
        }
コード例 #2
0
ファイル: EvmStateTests.cs プロジェクト: uzbekdev1/nethermind
        public void Things_are_cold_to_start_with()
        {
            EvmState    evmState    = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false);
            StorageCell storageCell = new StorageCell(TestItem.AddressA, 1);

            evmState.IsCold(TestItem.AddressA).Should().BeTrue();
            evmState.IsCold(storageCell).Should().BeTrue();
        }
コード例 #3
0
        public void Can_warm_up_many()
        {
            EvmState evmState = CreateEvmState();

            for (int i = 0; i < TestItem.Addresses.Length; i++)
            {
                evmState.WarmUp(TestItem.Addresses[i]);
                evmState.WarmUp(new StorageCell(TestItem.Addresses[i], 1));
            }

            for (int i = 0; i < TestItem.Addresses.Length; i++)
            {
                evmState.IsCold(TestItem.Addresses[i]).Should().BeFalse();
                evmState.IsCold(new StorageCell(TestItem.Addresses[i], 1)).Should().BeFalse();
            }
        }
コード例 #4
0
ファイル: EvmStateTests.cs プロジェクト: uzbekdev1/nethermind
        public void Can_warm_up_many()
        {
            EvmState evmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false);

            for (int i = 0; i < TestItem.Addresses.Length; i++)
            {
                evmState.WarmUp(TestItem.Addresses[i]);
                evmState.WarmUp(new StorageCell(TestItem.Addresses[i], 1));
            }

            for (int i = 0; i < TestItem.Addresses.Length; i++)
            {
                evmState.IsCold(TestItem.Addresses[i]).Should().BeFalse();
                evmState.IsCold(new StorageCell(TestItem.Addresses[i], 1)).Should().BeFalse();
            }
        }
コード例 #5
0
        public void Can_warm_address_up_twice()
        {
            EvmState evmState = CreateEvmState();
            Address  address  = TestItem.AddressA;

            evmState.WarmUp(address);
            evmState.WarmUp(address);
            evmState.IsCold(address).Should().BeFalse();
        }
コード例 #6
0
ファイル: EvmStateTests.cs プロジェクト: uzbekdev1/nethermind
        public void Can_warm_address_up_twice()
        {
            EvmState evmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false);
            Address  address  = TestItem.AddressA;

            evmState.WarmUp(address);
            evmState.WarmUp(address);
            evmState.IsCold(address).Should().BeFalse();
        }
コード例 #7
0
        public void Can_warm_storage_up_twice()
        {
            EvmState    evmState    = CreateEvmState();
            Address     address     = TestItem.AddressA;
            StorageCell storageCell = new(address, 1);

            evmState.WarmUp(storageCell);
            evmState.WarmUp(storageCell);
            evmState.IsCold(storageCell).Should().BeFalse();
        }
コード例 #8
0
ファイル: EvmStateTests.cs プロジェクト: uzbekdev1/nethermind
        public void Address_to_commit_keeps_it_warm()
        {
            EvmState parentEvmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false);
            EvmState evmState       = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false);

            evmState.WarmUp(TestItem.AddressA);

            evmState.CommitToParent(parentEvmState);
            parentEvmState.IsCold(TestItem.AddressA).Should().BeFalse();
        }
コード例 #9
0
ファイル: EvmStateTests.cs プロジェクト: uzbekdev1/nethermind
        public void Can_warm_storage_up_twice()
        {
            EvmState    evmState    = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false);
            Address     address     = TestItem.AddressA;
            StorageCell storageCell = new StorageCell(address, 1);

            evmState.WarmUp(storageCell);
            evmState.WarmUp(storageCell);
            evmState.IsCold(storageCell).Should().BeFalse();
        }
コード例 #10
0
        public void Address_to_restore_keeps_it_cold()
        {
            EvmState parentEvmState = CreateEvmState();

            using (EvmState evmState = CreateEvmState(parentEvmState))
            {
                evmState.WarmUp(TestItem.AddressA);
            }

            parentEvmState.IsCold(TestItem.AddressA).Should().BeTrue();
        }
コード例 #11
0
        public void Storage_to_restore_keeps_it_cold()
        {
            EvmState    parentEvmState = CreateEvmState();
            StorageCell storageCell    = new(TestItem.AddressA, 1);

            using (EvmState evmState = CreateEvmState(parentEvmState))
            {
                evmState.WarmUp(storageCell);
            }

            parentEvmState.IsCold(storageCell).Should().BeTrue();
        }
コード例 #12
0
        public void Address_to_commit_keeps_it_warm()
        {
            EvmState parentEvmState = CreateEvmState();

            using (EvmState evmState = CreateEvmState(parentEvmState))
            {
                evmState.WarmUp(TestItem.AddressA);
                evmState.CommitToParent(parentEvmState);
            }

            parentEvmState.IsCold(TestItem.AddressA).Should().BeFalse();
        }
コード例 #13
0
        public void Storage_to_commit_keeps_it_warm()
        {
            EvmState    parentEvmState = CreateEvmState();
            StorageCell storageCell    = new(TestItem.AddressA, 1);

            using (EvmState evmState = CreateEvmState(parentEvmState))
            {
                evmState.WarmUp(storageCell);
                evmState.CommitToParent(parentEvmState);
            }

            parentEvmState.IsCold(storageCell).Should().BeFalse();
        }