Fix import_secrets_config to actually process the bitcoin config

Upstream Cake declares bitcoinConfigPath + bitcoinOutputPath at the top of
tool/import_secrets_config.dart but never references them in the function
body. Result: every fresh clone runs 'dart run tool/generate_new_secrets.dart'
and ends up with cw_evm/cw_solana/cw_tron/cw_nano/.secrets.g.dart populated
but cw_bitcoin/lib/.secrets.g.dart still missing — and the Linux build
fails on the cw_bitcoin import that needs breezApiKey.

Plumb bitcoin into the pipeline the same way the others are. The bitcoin
JSON config (tool/.bitcoin-secrets-config.json) only has breezApiKey today,
which we populate as an empty string since Lightning is disabled.
This commit is contained in:
jwinterm
2026-05-14 20:49:25 -04:00
parent 6d22ba76ec
commit 399764be5f
+15
View File
@@ -49,6 +49,15 @@ Future<void> importSecretsConfig() async {
final nanoOutput =
nanoInput.keys.fold('', (String acc, String val) => acc + generateConst(val, nanoInput));
// Hash Wallet: upstream Cake declares bitcoinConfigPath/bitcoinOutputPath
// but never processes them, leaving cw_bitcoin/lib/.secrets.g.dart missing
// and the build broken on a fresh clone. Add it to the pipeline.
final bitcoinOutputFile = File(bitcoinOutputPath);
final bitcoinInput =
json.decode(File(bitcoinConfigPath).readAsStringSync()) as Map<String, dynamic>;
final bitcoinOutput =
bitcoinInput.keys.fold('', (String acc, String val) => acc + generateConst(val, bitcoinInput));
if (outputFile.existsSync()) {
await outputFile.delete();
}
@@ -78,4 +87,10 @@ Future<void> importSecretsConfig() async {
}
await nanoOutputFile.writeAsString(nanoOutput);
if (bitcoinOutputFile.existsSync()) {
await bitcoinOutputFile.delete();
}
await bitcoinOutputFile.writeAsString(bitcoinOutput);
}