Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit 08ffc32

Browse files
committed
add Clear()
1 parent 0866300 commit 08ffc32

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

store/gaskv/store.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type IStoreTracer interface {
1414
Set([]byte, []byte, string)
1515
Delete([]byte, string)
1616
DerivePrestateToJson() []byte
17+
Clear()
1718
}
1819

1920
var _ types.KVStore = &Store{}

types/tracer.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ func (st *StoreTracer) getOrSetModuleTrace(module string) (mt *ModuleTrace) {
9191
return
9292
}
9393

94+
func (st *StoreTracer) Clear() {
95+
st.mu.Lock()
96+
defer st.mu.Unlock()
97+
st.Modules = map[string]*ModuleTrace{}
98+
}
99+
94100
type StoreTraceDump struct {
95101
Modules map[string]ModuleTraceDump `json:"modules"`
96102
}

0 commit comments

Comments
 (0)