-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04a6897
commit 4184906
Showing
9 changed files
with
72 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package statedb | ||
|
||
// Copyright (c) 2023-2024 Nibi, Inc. | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
) | ||
|
||
// DebugDirtiesCount is a test helper to inspect how many entries in the journal | ||
// are still dirty (uncommitted). After calling [StateDB.Commit], this function | ||
// should return zero. | ||
func (s *StateDB) DebugDirtiesCount() int { | ||
dirtiesCount := 0 | ||
for _, dirtyCount := range s.Journal.dirties { | ||
dirtiesCount += dirtyCount | ||
} | ||
return dirtiesCount | ||
} | ||
|
||
// DebugDirties is a test helper that returns the journal's dirty account changes map. | ||
func (s *StateDB) DebugDirties() map[common.Address]int { | ||
return s.Journal.dirties | ||
} | ||
|
||
// DebugEntries is a test helper that returns the sequence of [JournalChange] | ||
// objects added during execution. | ||
func (s *StateDB) DebugEntries() []JournalChange { | ||
return s.Journal.entries | ||
} | ||
|
||
// DebugStateObjects is a test helper that returns returns a copy of the | ||
// [StateDB.stateObjects] map. | ||
func (s *StateDB) DebugStateObjects() map[common.Address]*stateObject { | ||
copyOfMap := make(map[common.Address]*stateObject) | ||
for key, val := range s.stateObjects { | ||
copyOfMap[key] = val | ||
} | ||
return copyOfMap | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.