public void Nothing_to_commit() { EvmState parentEvmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false); EvmState evmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false); evmState.CommitToParent(parentEvmState); }
public void Commit_adds_refunds() { EvmState parentEvmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false); EvmState evmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false); evmState.CommitToParent(parentEvmState); parentEvmState.Refund.Should().Be(evmState.Refund); }
public void Nothing_to_commit() { EvmState parentEvmState = CreateEvmState(); using (EvmState evmState = CreateEvmState(parentEvmState)) { evmState.CommitToParent(parentEvmState); } }
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 Destroy_list_is_committed() { EvmState parentEvmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false); EvmState evmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false); evmState.DestroyList.Add(Address.Zero); evmState.CommitToParent(parentEvmState); parentEvmState.DestroyList.Contains(Address.Zero).Should().BeTrue(); }
public void Logs_are_committed() { EvmState parentEvmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false); EvmState evmState = new EvmState(10000, new ExecutionEnvironment(), ExecutionType.Call, true, false); LogEntry logEntry = new LogEntry(Address.Zero, Bytes.Empty, Array.Empty <Keccak>()); evmState.Logs.Add(logEntry); evmState.CommitToParent(parentEvmState); parentEvmState.Logs.Contains(logEntry).Should().BeTrue(); }
public void Commit_adds_refunds() { EvmState parentEvmState = CreateEvmState(); using (EvmState evmState = CreateEvmState(parentEvmState)) { evmState.Refund = 333; evmState.CommitToParent(parentEvmState); } parentEvmState.Refund.Should().Be(333); }
public void Destroy_list_is_committed() { EvmState parentEvmState = CreateEvmState(); using (EvmState evmState = CreateEvmState(parentEvmState)) { evmState.DestroyList.Add(Address.Zero); evmState.CommitToParent(parentEvmState); } parentEvmState.DestroyList.Contains(Address.Zero).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 Logs_are_committed() { EvmState parentEvmState = CreateEvmState(); LogEntry logEntry = new(Address.Zero, Bytes.Empty, Array.Empty <Keccak>()); using (EvmState evmState = CreateEvmState(parentEvmState)) { evmState.Logs.Add(logEntry); evmState.CommitToParent(parentEvmState); } parentEvmState.Logs.Contains(logEntry).Should().BeTrue(); }
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(); }