From 399764be5ff52b14748a828c568a210396f1bc4a Mon Sep 17 00:00:00 2001 From: jwinterm Date: Thu, 14 May 2026 20:49:25 -0400 Subject: [PATCH] Fix import_secrets_config to actually process the bitcoin config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- tool/import_secrets_config.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tool/import_secrets_config.dart b/tool/import_secrets_config.dart index dd333c7e2..db0388769 100644 --- a/tool/import_secrets_config.dart +++ b/tool/import_secrets_config.dart @@ -49,6 +49,15 @@ Future 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; + final bitcoinOutput = + bitcoinInput.keys.fold('', (String acc, String val) => acc + generateConst(val, bitcoinInput)); + if (outputFile.existsSync()) { await outputFile.delete(); } @@ -78,4 +87,10 @@ Future importSecretsConfig() async { } await nanoOutputFile.writeAsString(nanoOutput); + + if (bitcoinOutputFile.existsSync()) { + await bitcoinOutputFile.delete(); + } + + await bitcoinOutputFile.writeAsString(bitcoinOutput); }