cosmos-sdk/store/wrapper/wrapper.go
dependabot[bot] ff30f6e0a4
build(deps): Bump github.com/cosmos/iavl from 1.0.1 to 1.1.1 in store (#19770)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cool Developer <cool199966@outlook.com>
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
2024-03-20 12:03:18 +00:00

35 lines
776 B
Go

package wrapper
import (
dbm "github.com/cosmos/cosmos-db"
idb "github.com/cosmos/iavl/db"
)
var _ idb.DB = &DBWrapper{}
// DBwrapper is a simple wrapper of dbm.DB that implements the iavl.DB interface.
type DBWrapper struct {
dbm.DB
}
// NewDBWrapper creates a new DBWrapper instance.
func NewDBWrapper(db dbm.DB) *DBWrapper {
return &DBWrapper{db}
}
func (dbw *DBWrapper) NewBatch() idb.Batch {
return dbw.DB.NewBatch()
}
func (dbw *DBWrapper) NewBatchWithSize(size int) idb.Batch {
return dbw.DB.NewBatchWithSize(size)
}
func (dbw *DBWrapper) Iterator(start, end []byte) (idb.Iterator, error) {
return dbw.DB.Iterator(start, end)
}
func (dbw *DBWrapper) ReverseIterator(start, end []byte) (idb.Iterator, error) {
return dbw.DB.ReverseIterator(start, end)
}