MCPcopy Create free account
hub / github.com/CPChain/chain / TestTouchDelete

Method TestTouchDelete

core/state/statedb_test.go:406–421  ·  view source on GitHub ↗
(c *check.C)

Source from the content-addressed store, hash-verified

404}
405
406func (s *StateSuite) TestTouchDelete(c *check.C) {
407 s.state.GetOrNewStateObject(common.Address{})
408 root, _ := s.state.Commit(false)
409 s.state.Reset(root)
410
411 snapshot := s.state.Snapshot()
412 s.state.AddBalance(common.Address{}, new(big.Int))
413
414 if len(s.state.journal.dirties) != 1 {
415 c.Fatal("expected one dirty state object")
416 }
417 s.state.RevertToSnapshot(snapshot)
418 if len(s.state.journal.dirties) != 0 {
419 c.Fatal("expected no dirty state object")
420 }
421}
422
423// TestCopyOfCopy tests that modified objects are carried over to the copy, and the copy of the copy.
424// See https://github.com/ethereum/go-ethereum/pull/15225#issuecomment-380191512

Callers

nothing calls this directly

Calls 7

GetOrNewStateObjectMethod · 0.80
CommitMethod · 0.65
ResetMethod · 0.65
SnapshotMethod · 0.65
AddBalanceMethod · 0.65
FatalMethod · 0.65
RevertToSnapshotMethod · 0.65

Tested by

no test coverage detected