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

chore: using pre-defined flag variables #21794

Merged
merged 1 commit into from
Sep 18, 2024
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
chore: using pre-defined flag variable if possible
  • Loading branch information
lilasxie committed Sep 18, 2024
commit 6b4bfe55de9591943b53fea6a2f5ac5f30766f5f
4 changes: 2 additions & 2 deletions server/v2/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func TestReadConfig(t *testing.T) {
v, err := serverv2.ReadConfig(configPath)
require.NoError(t, err)

require.Equal(t, v.GetString("grpc.address"), grpc.DefaultConfig().Address)
require.Equal(t, v.GetString("store.app-db-backend"), store.DefaultConfig().AppDBBackend)
require.Equal(t, v.GetString(grpc.FlagAddress), grpc.DefaultConfig().Address)
require.Equal(t, v.GetString(store.FlagAppDBBackend), store.DefaultConfig().AppDBBackend)
}

func TestUnmarshalSubConfig(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion simapp/v2/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
sdkmath "cosmossdk.io/math"
serverv2 "cosmossdk.io/server/v2"
comettypes "cosmossdk.io/server/v2/cometbft/types"
serverv2store "cosmossdk.io/server/v2/store"
"cosmossdk.io/store/v2/db"
banktypes "cosmossdk.io/x/bank/types"

Expand All @@ -36,7 +37,7 @@ func NewTestApp(t *testing.T) (*SimApp[transaction.Tx], context.Context) {
logger := log.NewTestLogger(t)

vp := viper.New()
vp.Set("store.app-db-backend", string(db.DBTypeGoLevelDB))
vp.Set(serverv2store.FlagAppDBBackend, string(db.DBTypeGoLevelDB))
vp.Set(serverv2.FlagHome, t.TempDir())

app := NewSimApp[transaction.Tx](logger, vp)
Expand Down
Loading