mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user