Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct config key for db_backend (backport #17406) #17412

Merged
merged 3 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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