24 lines
450 B
Go
24 lines
450 B
Go
package store
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
dbm "github.com/tendermint/tmlibs/db"
|
|
)
|
|
|
|
type dbStoreAdapter struct {
|
|
dbm.DB
|
|
}
|
|
|
|
// Implements Store.
|
|
func (dbStoreAdapter) GetStoreType() StoreType {
|
|
return sdk.StoreTypeDB
|
|
}
|
|
|
|
// Implements KVStore.
|
|
func (dsa dbStoreAdapter) CacheWrap() CacheWrap {
|
|
return NewCacheKVStore(dsa)
|
|
}
|
|
|
|
// dbm.DB implements KVStore so we can CacheKVStore it.
|
|
var _ KVStore = dbStoreAdapter{dbm.DB(nil)}
|