CI: fix secrets generator early-return bug + inject Trocador via sed #3

Merged
such-gitea merged 1 commits from github-such-software/hash-wallet:dev into dev 2026-05-15 19:52:13 -04:00
Owner

Previous CI step pre-wrote tool/.secrets-config.json with a curated key
subset. The generator at tool/generate_secrets_config.dart has an early
return when the base config exists (line 61), which ALSO skips creating
the per-module configs (evm/solana/nano/tron/bitcoin). Result: dozens
of secrets.xxx references in cw_bitcoin/cw_evm/cw_nano/lib/main.dart
failed at compile time with 'Undefined name'.

New approach (matches Cake's CI pattern):

  1. Run generate_new_secrets.dart with no pre-existing config → it creates
    all the JSON files from the full SecretKey list with empty defaults,
    then writes the per-module .secrets.g.dart files
  2. sed-inject Trocador values into lib/.secrets.g.dart

Side effect: changenow_exchange_provider.dart's 'Map<String,dynamic> not
assignable to Map<String,String>' error also resolves — that error was
caused by Dart inferring 'dynamic' for the apiKey ternary because both
arms referenced undefined secrets. Once secrets exist as empty strings,
inference settles on String.

Issue Number (if Applicable): Fixes #

Description

Please include a summary of the changes and which issue is fixed / feature is added.

Pull Request - Checklist

  • Initial Manual Tests Passed
  • Double check modified code and verify it with the feature/task requirements
  • Format code
  • Look for code duplication
  • Clear naming for variables and methods
  • Manual tests in accessibility mode (TalkBack on Android) passed
Previous CI step pre-wrote tool/.secrets-config.json with a curated key subset. The generator at tool/generate_secrets_config.dart has an early return when the base config exists (line 61), which ALSO skips creating the per-module configs (evm/solana/nano/tron/bitcoin). Result: dozens of secrets.xxx references in cw_bitcoin/cw_evm/cw_nano/lib/main.dart failed at compile time with 'Undefined name'. New approach (matches Cake's CI pattern): 1. Run generate_new_secrets.dart with no pre-existing config → it creates all the JSON files from the full SecretKey list with empty defaults, then writes the per-module .secrets.g.dart files 2. sed-inject Trocador values into lib/.secrets.g.dart Side effect: changenow_exchange_provider.dart's 'Map<String,dynamic> not assignable to Map<String,String>' error also resolves — that error was caused by Dart inferring 'dynamic' for the apiKey ternary because both arms referenced undefined secrets. Once secrets exist as empty strings, inference settles on String. Issue Number (if Applicable): Fixes # # Description Please include a summary of the changes and which issue is fixed / feature is added. # Pull Request - Checklist - [ ] Initial Manual Tests Passed - [ ] Double check modified code and verify it with the feature/task requirements - [ ] Format code - [ ] Look for code duplication - [ ] Clear naming for variables and methods - [ ] Manual tests in accessibility mode (TalkBack on Android) passed
such-gitea added 1 commit 2026-05-15 19:52:04 -04:00
CI: fix secrets generator early-return bug + inject Trocador via sed
Some checks failed
Hash Wallet Linux build / build (pull_request) Failing after 10m11s
87d58c7494
Previous CI step pre-wrote tool/.secrets-config.json with a curated key
subset. The generator at tool/generate_secrets_config.dart has an early
return when the base config exists (line 61), which ALSO skips creating
the per-module configs (evm/solana/nano/tron/bitcoin). Result: dozens
of secrets.xxx references in cw_bitcoin/cw_evm/cw_nano/lib/main.dart
failed at compile time with 'Undefined name'.

New approach (matches Cake's CI pattern):
1. Run generate_new_secrets.dart with no pre-existing config → it creates
   all the JSON files from the full SecretKey list with empty defaults,
   then writes the per-module .secrets.g.dart files
2. sed-inject Trocador values into lib/.secrets.g.dart

Side effect: changenow_exchange_provider.dart's 'Map<String,dynamic> not
assignable to Map<String,String>' error also resolves — that error was
caused by Dart inferring 'dynamic' for the apiKey ternary because both
arms referenced undefined secrets. Once secrets exist as empty strings,
inference settles on String.
such-gitea merged commit dc5631c22a into dev 2026-05-15 19:52:13 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Builds/hash-wallet#3