Merge PR #7265: Tendermint Block Pruning
This commit is contained in:
@@ -125,6 +125,12 @@ func (st *Store) SetPruning(_ types.PruningOptions) {
|
||||
panic("cannot set pruning options on an initialized IAVL store")
|
||||
}
|
||||
|
||||
// SetPruning panics as pruning options should be provided at initialization
|
||||
// since IAVl accepts pruning options directly.
|
||||
func (st *Store) GetPruning() types.PruningOptions {
|
||||
panic("cannot get pruning options on an initialized IAVL store")
|
||||
}
|
||||
|
||||
// VersionExists returns whether or not a given version is stored.
|
||||
func (st *Store) VersionExists(version int64) bool {
|
||||
return st.tree.VersionExists(version)
|
||||
|
||||
+6
-1
@@ -49,4 +49,9 @@ func (s Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.Cach
|
||||
func (s *Store) Commit() (id types.CommitID) { return }
|
||||
|
||||
func (s *Store) SetPruning(pruning types.PruningOptions) {}
|
||||
func (s Store) LastCommitID() (id types.CommitID) { return }
|
||||
|
||||
// GetPruning is a no-op as pruning options cannot be directly set on this store.
|
||||
// They must be set on the root commit multi-store.
|
||||
func (s *Store) GetPruning() types.PruningOptions { return types.PruningOptions{} }
|
||||
|
||||
func (s Store) LastCommitID() (id types.CommitID) { return }
|
||||
|
||||
@@ -31,3 +31,7 @@ func (cdsa commitDBStoreAdapter) LastCommitID() types.CommitID {
|
||||
}
|
||||
|
||||
func (cdsa commitDBStoreAdapter) SetPruning(_ types.PruningOptions) {}
|
||||
|
||||
// GetPruning is a no-op as pruning options cannot be directly set on this store.
|
||||
// They must be set on the root commit multi-store.
|
||||
func (cdsa commitDBStoreAdapter) GetPruning() types.PruningOptions { return types.PruningOptions{} }
|
||||
|
||||
@@ -27,9 +27,11 @@ func (ts *Store) Commit() (id types.CommitID) {
|
||||
return
|
||||
}
|
||||
|
||||
// Implements CommitStore
|
||||
func (ts *Store) SetPruning(pruning types.PruningOptions) {
|
||||
}
|
||||
func (ts *Store) SetPruning(_ types.PruningOptions) {}
|
||||
|
||||
// GetPruning is a no-op as pruning options cannot be directly set on this store.
|
||||
// They must be set on the root commit multi-store.
|
||||
func (ts *Store) GetPruning() types.PruningOptions { return types.PruningOptions{} }
|
||||
|
||||
// Implements CommitStore
|
||||
func (ts *Store) LastCommitID() (id types.CommitID) {
|
||||
|
||||
@@ -21,8 +21,8 @@ type Committer interface {
|
||||
Commit() CommitID
|
||||
LastCommitID() CommitID
|
||||
|
||||
// TODO: Deprecate after 0.38.5
|
||||
SetPruning(PruningOptions)
|
||||
GetPruning() PruningOptions
|
||||
}
|
||||
|
||||
// Stores of MultiStore must implement CommitStore.
|
||||
|
||||
Reference in New Issue
Block a user