test(amm-ui): feed setup password via stdin so bootstrap never blocks

This commit is contained in:
Andrea Franz
2026-08-05 17:19:38 +02:00
parent c5b9508e4d
commit 200f429ec6
2 changed files with 15 additions and 16 deletions
+8 -9
View File
@@ -52,15 +52,14 @@ nix build .#integration-test -L
## Notes
- **Wallet password.** The wallet's key storage is encrypted with a password,
which you enter to **unlock** the wallet so the app can sign transactions (the
UI's **Connect** modal). During first-time setup you're prompted once for a
password (read from the terminal — it can't be scripted), but **that wallet is
a throwaway**: `restore-keys` then rebuilds it from the test mnemonic and sets
the **real** password to `TEST_WALLET_PASSWORD` (default `test`). So type
anything at the setup prompt; **unlock the UI with `test`** — not whatever you
typed there. Prefer no password? Run with `TEST_WALLET_PASSWORD=""` and unlock
with an empty password everywhere.
- **Wallet password.** The wallet's key storage is encrypted with a password
the one you enter to **unlock** it (the UI's **Connect** modal) so the app can
sign transactions. First-time setup reads a throwaway password (the script
feeds it via stdin, so it doesn't block), then `restore-keys` rebuilds the
wallet from the test mnemonic and sets the **real** password to
`TEST_WALLET_PASSWORD` (default `test`). So **unlock the UI with `test`**.
Prefer no password? Run with `TEST_WALLET_PASSWORD=""` and unlock with an empty
password.
- **Re-bootstrap.** `FORCE_BOOTSTRAP=1 apps/amm/tests/testnet/setup-amm-testnet.sh`
re-restores the isolated `.wallet` (rewrites only that directory).
- **Overrides.** `TEST_WALLET_HOME`, `TEST_MNEMONIC`, `TEST_WALLET_PASSWORD`,
+7 -7
View File
@@ -182,13 +182,13 @@ bootstrap_test_wallet() {
if [ -n "$TEST_SEQUENCER_ADDR" ]; then
log "${DIM}\$ wallet config set sequencer_addr $TEST_SEQUENCER_ADDR${RST}"
# NOTE: on a fresh home this triggers first-time wallet setup, which
# generates a THROWAWAY random-seed wallet and prompts once for a password
# (read from the terminal, so it can't be piped — just type anything, even
# empty). That wallet is immediately discarded: restore-keys below rebuilds
# the wallet from the test mnemonic and sets the REAL password to
# $TEST_WALLET_PASSWORD, which is what unlocks the wallet afterward.
wallet config set sequencer_addr "$TEST_SEQUENCER_ADDR" \
# On a fresh home the first wallet command triggers one-time setup, which
# reads a password from STDIN ("Input password:") and generates a THROWAWAY
# random-seed wallet. Feed the password so it never blocks; restore-keys
# below immediately rewrites storage from the test mnemonic and sets the real
# password to $TEST_WALLET_PASSWORD.
printf '%s\n' "$TEST_WALLET_PASSWORD" \
| wallet config set sequencer_addr "$TEST_SEQUENCER_ADDR" \
|| log "${YEL}⚠ 'wallet config set sequencer_addr' failed — configure the wallet manually.${RST}"
fi