From 49e1bc2073bd7c854aa78c9b0e27135cc4a62887 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Fri, 25 Oct 2024 06:38:52 -0500 Subject: [PATCH] feat(core): add ConfigMap type (#22361) --- core/CHANGELOG.md | 4 ++++ core/server/config.go | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index c234cc971948..62460682a648 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Features + +* [*22267](https://github.com/cosmos/cosmos-sdk/pull/22267) Add `server.ConfigMap` and `server.ModuleConfigMap` to replace `server.DynamicConfig` in module configuration. + ## [v1.0.0-alpha.3](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv1.0.0-alpha.3) ### Features diff --git a/core/server/config.go b/core/server/config.go index 997633fe46b3..f3974c48e8b7 100644 --- a/core/server/config.go +++ b/core/server/config.go @@ -6,3 +6,16 @@ type DynamicConfig interface { Get(string) any GetString(string) string } + +// ConfigMap is a recursive map of configuration values. +type ConfigMap map[string]any + +// ModuleConfigMap is used to specify module configuration. +// Keys (and there default values and types) should be set in Config +// and returned by module specific provider function. +type ModuleConfigMap struct { + Module string + Config ConfigMap +} + +func (ModuleConfigMap) IsManyPerContainerType() {}