cosmos-sdk/store/transient/store.go

44 lines
901 B
Go

package transient
import (
dbm "github.com/tendermint/tendermint/libs/db"
"github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/store/dbadapter"
)
var _ types.Committer = (*Store)(nil)
var _ types.KVStore = (*Store)(nil)
// Store is a wrapper for a MemDB with Commiter implementation
type Store struct {
dbadapter.Store
}
// Constructs new MemDB adapter
func NewStore() *Store {
return &Store{dbadapter.Store{dbm.NewMemDB()}}
}
// Implements CommitStore
// Commit cleans up Store.
func (ts *Store) Commit() (id types.CommitID) {
ts.Store = dbadapter.Store{dbm.NewMemDB()}
return
}
// Implements CommitStore
func (ts *Store) SetPruning(pruning types.PruningOptions) {
}
// Implements CommitStore
func (ts *Store) LastCommitID() (id types.CommitID) {
return
}
// Implements Store.
func (ts *Store) GetStoreType() types.StoreType {
return types.StoreTypeTransient
}