refactor!: remove deprecated sdk.NewLevelDB (#13380)

* refactor!: remove deprecated `sdk.NewLevelDB`

* updates
This commit is contained in:
Julien Robert 2022-09-25 12:16:31 +02:00 committed by GitHub
parent 55373cb614
commit 3de5aa8741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 17 deletions

View File

@ -113,6 +113,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### API Breaking Changes
* [#13380](https://github.com/cosmos/cosmos-sdk/pull/13380) Remove deprecated `sdk.NewLevelDB`.
* [#13378](https://github.com/cosmos/cosmos-sdk/pull/13378) Move `simapp.App` to `runtime.AppI`. `simapp.App` is now an alias of `runtime.AppI`.
* (tx) [#12659](https://github.com/cosmos/cosmos-sdk/pull/12659) Remove broadcast mode `block`.
* (db) [#13370](https://github.com/cosmos/cosmos-sdk/pull/13370) remove storev2alpha1, see also https://github.com/cosmos/cosmos-sdk/pull/13371

View File

@ -7,12 +7,8 @@ import (
"time"
"github.com/cosmos/cosmos-sdk/types/kv"
dbm "github.com/tendermint/tm-db"
)
// This is set at compile time. Could be cleveldb, defaults is goleveldb.
var backend = dbm.GoLevelDBBackend
// SortedJSON takes any JSON and returns it sorted by keys. Also, all white-spaces
// are removed.
// This method can be used to canonicalize JSON to be returned by GetSignBytes,
@ -101,19 +97,6 @@ func ParseTime(T any) (time.Time, error) { //nolint:gocritic
return result.UTC().Round(0), nil
}
// NewLevelDB instantiate a new LevelDB instance according to DBBackend.
//
// Deprecated: Use NewDB (from "github.com/tendermint/tm-db") instead. Suggested backendType is tendermint config's DBBackend value.
func NewLevelDB(name, dir string) (db dbm.DB, err error) {
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("couldn't create db: %v", r)
}
}()
return dbm.NewDB(name, backend, dir)
}
// copy bytes
func CopyBytes(bz []byte) (ret []byte) {
if bz == nil {