[LWDM] chore(llc): add config_generic_a4 live config - #20298
Conversation
config_generic_a4 live configconfig_generic_a4 live config
Web Tools Build Status
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new LiveConfig entry (config_generic_a4) to @ledgerhq/live-common and wires it into the shared LiveConfig schema, along with a resolver helper and Jest coverage to interpret the config at runtime.
Changes:
- Register a new LiveConfig key
config_generic_a4and include it inliveConfigaggregation. - Add
a4LiveConfig schema + Zod parsing andresolveA4ChainConfig()resolution logic. - Add unit tests for resolver behavior and the config schema defaults.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| libs/ledger-live-common/src/config/sharedConfig.ts | Includes a4Config in the global liveConfig schema so the key is registered. |
| libs/ledger-live-common/src/bridge/generic-coin-framework/a4/config.ts | Defines config_generic_a4 schema/defaults and provides resolveA4ChainConfig() to interpret it. |
| libs/ledger-live-common/src/bridge/generic-coin-framework/a4/config.test.ts | Adds Jest tests for resolver semantics and schema default registration. |
| .changeset/friendly-schools-deliver.md | Adds a patch changeset for @ledgerhq/live-common. |
Rsdoctor Bundle Diff AnalysisFound 7 projects in monorepo, 7 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 desktop-mainPath:
📁 desktop-preloaderPath:
📁 desktop-rendererPath:
📁 desktop-webviewDappPreloaderPath:
📁 desktop-webviewPreloaderPath:
📁 desktop-workersPath:
📁 mobilePath:
Generated by Rsdoctor GitHub Action |
a8c8390 to
4e4bf02
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (3)
libs/ledger-live-common/src/bridge/generic-coin-framework/a4/config.ts:126
- The parameter name
networkis ambiguous given that this resolver is keyed by the A4 network id strings (e.g. "avalanche_c_chain"). Renaming it tonetworkIdwould better communicate what callers must pass.
export function resolveA4ChainConfig(network: string): A4ChainResolution {
libs/ledger-live-common/src/bridge/generic-coin-framework/a4/config.ts:146
- The catch block can only be reached when
LiveConfig.getValueByKeythrows because the global LiveConfig schema was never set (it throws "Config not set" whenconfigis empty). The log message currently implies onlyconfig_generic_a4is missing, which is misleading when debugging.
} catch {
if (warnedConfigMissing) return A4_OFF;
warnedConfigMissing = true;
log("a4", "config_generic_a4 not set in LiveConfig - A4 disabled");
libs/ledger-live-common/src/config/sharedConfig.ts:33
- Repo review guidance flags
libs/ledger-live-common/as maintenance-only (see.agents/agents/code-reviewer.md:44). This adds a new feature module undersrc/bridge/generic-coin-framework/a4/. If this is expected, it would help to confirm (or consider placing this in a more appropriate package) to avoid further feature growth in live-common.
import { concordiumConfig } from "../families/concordium/config";
import { a4Config } from "../bridge/generic-coin-framework/a4/config";
|



📝 Description
Introduce
config_generic_a4a cross-family LiveConfig key driving A4 indexer integration.enabled/registerOnlyswitches andenvironment(stg/ppr/prd).resolveA4ChainConfig(currencyId)returning{ read, register, environment }with log-once fallback{ enabled: false, registerOnly: true }sharedConfig.ts🔗 Context