app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

commit 7603e1ce73b3bd0648e6b4b098adba96e48ae9fc
parent 3142aed6cc339622d1ac3a5e4234153407052fa8
Author: triesap <triesap@radroots.dev>
Date:   Mon, 19 Jan 2026 17:20:58 +0000

app: use default key maps in config

- add AppConfig::from_key_maps helper
- set app_config_default to use key map fixtures
- keep AppConfig::empty for blank configs
- extend config default test coverage

Diffstat:
Mapp/src/config.rs | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/app/src/config.rs b/app/src/config.rs @@ -105,10 +105,17 @@ impl AppConfig { keystore: AppKeystoreConfig::default_config(), } } + + pub fn from_key_maps(key_maps: AppKeyMapConfig) -> Self { + Self { + datastore: AppDatastoreConfig::default_config(key_maps), + keystore: AppKeystoreConfig::default_config(), + } + } } pub fn app_config_default() -> AppConfig { - AppConfig::empty() + AppConfig::from_key_maps(app_key_maps_default()) } pub fn app_config_from_env() -> AppConfig { @@ -151,6 +158,10 @@ mod tests { let config = app_config_default(); let from_env = app_config_from_env(); assert_eq!(config, from_env); + assert_eq!( + config.datastore.key_maps.key_map.get("nostr_key"), + Some(&APP_DATASTORE_KEY_NOSTR_KEY) + ); } #[test]