diff --git a/apps/amm/tests/README.md b/apps/amm/tests/README.md index efc7a15..62fdf8f 100644 --- a/apps/amm/tests/README.md +++ b/apps/amm/tests/README.md @@ -52,9 +52,15 @@ nix build .#integration-test -L ## Notes -- **Wallet password.** The isolated wallet is restored with password `test` - (`TEST_WALLET_PASSWORD`). If the UI shows the **Connect** modal instead of - auto-opening, unlock with `test`. +- **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. - **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`, diff --git a/apps/amm/tests/testnet/setup-amm-testnet.sh b/apps/amm/tests/testnet/setup-amm-testnet.sh index a361973..c522f9d 100755 --- a/apps/amm/tests/testnet/setup-amm-testnet.sh +++ b/apps/amm/tests/testnet/setup-amm-testnet.sh @@ -182,16 +182,18 @@ bootstrap_test_wallet() { if [ -n "$TEST_SEQUENCER_ADDR" ]; then log "${DIM}\$ wallet config set sequencer_addr $TEST_SEQUENCER_ADDR${RST}" - # On a fresh home this triggers first-time wallet setup, which prompts for a - # password (and generates a throwaway random seed). Feed the password via - # stdin so the bootstrap stays non-interactive; restore-keys below then - # replaces those keys with the deterministic test mnemonic. - printf '%s\n' "$TEST_WALLET_PASSWORD" \ - | wallet config set sequencer_addr "$TEST_SEQUENCER_ADDR" \ + # 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" \ || log "${YEL}⚠ 'wallet config set sequencer_addr' failed — configure the wallet manually.${RST}" fi - # restore-keys reads the mnemonic then the password from stdin. + # restore-keys reads the mnemonic then the password from stdin (non-interactive) + # and REWRITES storage — so the wallet's password becomes $TEST_WALLET_PASSWORD. log "${DIM}\$ printf '\\n\\n' | wallet restore-keys --depth $TEST_WALLET_DEPTH${RST}" printf '%s\n%s\n' "$TEST_MNEMONIC" "$TEST_WALLET_PASSWORD" \ | wallet restore-keys --depth "$TEST_WALLET_DEPTH" \