Skip to content

Commit

Permalink
refactor!: remove deprecated sdk.NewLevelDB (cosmos#13380)
Browse files Browse the repository at this point in the history
* refactor!: remove deprecated `sdk.NewLevelDB`

* updates
  • Loading branch information
julienrbrt authored and Wryhder committed Oct 26, 2022
1 parent 46d4742 commit 39aa965
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 39aa965

Please sign in to comment.