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(); }
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(); }
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(); } }
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(); } }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }