diff --git a/server/types/app.go b/server/types/app.go index 798a4475dbbe..d08cfff0ea9b 100644 --- a/server/types/app.go +++ b/server/types/app.go @@ -8,6 +8,7 @@ import ( cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/gogoproto/grpc" + "cosmossdk.io/core/server" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/store/snapshots" @@ -26,9 +27,7 @@ type ( // literal defined on the server Context. Note, casting Get calls may not yield // the expected types and could result in type assertion errors. It is recommend // to either use the cast package or perform manual conversion for safety. - AppOptions interface { - Get(string) interface{} - } + AppOptions = server.DynamicConfig // Application defines an application interface that wraps abci.Application. // The interface defines the necessary contracts to be implemented in order diff --git a/server/util_test.go b/server/util_test.go index 11f5cbb208c9..39a9e6c35528 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -492,4 +492,8 @@ func (m mapGetter) Get(key string) interface{} { return m[key] } +func (m mapGetter) GetString(key string) string { + return m[key].(string) +} + var _ servertypes.AppOptions = mapGetter{} diff --git a/testutil/sims/app_helpers.go b/testutil/sims/app_helpers.go index 08d9a71656d1..42d56ced3c4c 100644 --- a/testutil/sims/app_helpers.go +++ b/testutil/sims/app_helpers.go @@ -307,6 +307,15 @@ func (m AppOptionsMap) Get(key string) interface{} { return v } +func (m AppOptionsMap) GetString(key string) string { + v, ok := m[key] + if !ok { + return "" + } + + return v.(string) +} + func NewAppOptionsWithFlagHome(homePath string) servertypes.AppOptions { return AppOptionsMap{ flags.FlagHome: homePath, diff --git a/testutils/sims/runner.go b/testutils/sims/runner.go index d1ae04fc6f94..918770725387 100644 --- a/testutils/sims/runner.go +++ b/testutils/sims/runner.go @@ -235,6 +235,10 @@ func (f AppOptionsFn) Get(k string) any { return f(k) } +func (f AppOptionsFn) GetString(k string) string { + return f(k).(string) +} + // FauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of // an IAVLStore for faster simulation speed. func FauxMerkleModeOpt(bapp *baseapp.BaseApp) {