Skip to content

Commit

Permalink
fix: use correct config key for db_backend (backport cosmos#17406) (c…
Browse files Browse the repository at this point in the history
…osmos#17412)

Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
2 people authored and rootulp committed Nov 7, 2023
1 parent 1aa6d60 commit 5f62bd6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/genutil) [#17296](https://github.com/cosmos/cosmos-sdk/pull/17296) Add `MigrateHandler` to allow reuse migrate genesis related function.
* In v0.46, v0.47 this function is additive to the `genesis migrate` command. However in v0.50+, adding custom migrations to the `genesis migrate` command is directly possible.

## Bug Fixes

* (server) [#17181](https://github.com/cosmos/cosmos-sdk/pull/17181) Fix `db_backend` lookup fallback from `config.toml`.

## [v0.46.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.14) - 2023-07-17

### Features
Expand Down
2 changes: 1 addition & 1 deletion server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func GetAppDBBackend(opts types.AppOptions) dbm.BackendType {
rv = sdk.DBBackend
}
if len(rv) == 0 {
rv = cast.ToString(opts.Get("db-backend"))
rv = cast.ToString(opts.Get("db_backend"))
}
if len(rv) != 0 {
return dbm.BackendType(rv)
Expand Down
14 changes: 7 additions & 7 deletions server/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,10 @@ func TestGetAppDBBackend(t *testing.T) {
},

{
name: "only db-backend set",
name: "only db_backend set",
dbBack: "",
opts: mapGetter{"db-backend": "db-backend value 1"},
exp: dbm.BackendType("db-backend value 1"),
opts: mapGetter{"db_backend": "db_backend value 1"},
exp: dbm.BackendType("db_backend value 1"),
},
{
name: "only DBBackend set",
Expand All @@ -491,7 +491,7 @@ func TestGetAppDBBackend(t *testing.T) {
{
name: "app-db-backend and db-backend set",
dbBack: "",
opts: mapGetter{"db-backend": "db-backend value 4", "app-db-backend": "app-db-backend value 5"},
opts: mapGetter{"db_backend": "db_backend value 4", "app-db-backend": "app-db-backend value 5"},
exp: dbm.BackendType("app-db-backend value 5"),
},
{
Expand All @@ -501,16 +501,16 @@ func TestGetAppDBBackend(t *testing.T) {
exp: dbm.BackendType("app-db-backend value 7"),
},
{
name: "db-backend and DBBackend set",
name: "db_backend and DBBackend set",
dbBack: "DBBackend value 8",
opts: mapGetter{"db-backend": "db-backend value 9"},
opts: mapGetter{"db_backend": "db_backend value 9"},
exp: dbm.BackendType("DBBackend value 8"),
},

{
name: "all of app-db-backend db-backend DBBackend set",
dbBack: "DBBackend value 10",
opts: mapGetter{"db-backend": "db-backend value 11", "app-db-backend": "app-db-backend value 12"},
opts: mapGetter{"db_backend": "db_backend value 11", "app-db-backend": "app-db-backend value 12"},
exp: dbm.BackendType("app-db-backend value 12"),
},
}
Expand Down

0 comments on commit 5f62bd6

Please sign in to comment.