fix: ladder force-select reserve_pub extract (1.20.2)

Wallet accept/tx dumps mix log lines with JSON; json.loads from the
first brace always failed, and regex only scanned accept (no reservePub).
Parse with JSONDecoder.raw_decode, scrape both files, score by WID/amount.
Prefer Homebrew python for taler-helper-sqlite3; find_wallet_cli prefers
ts-core 1.6.x. Soft-skip max-1 mint 5110/P0001 as ceiling.

Verified on live GOA: mid rungs force-select HTTP 200 + confirm 204 → OK_BANK.
This commit is contained in:
Hernâni Marques 2026-07-19 13:45:19 +02:00
parent ac01e4ecfe
commit 80643e6b3f
No known key found for this signature in database
5 changed files with 135 additions and 70 deletions

20
lib.sh
View file

@ -1512,12 +1512,20 @@ find_wallet_cli() {
echo "$WALLET_CLI"; return 0
fi
local c cand
# WALLET_CLI / WALLET_CLI_CANDIDATES from env; then portable package paths only.
# WALLET_CLI / WALLET_CLI_CANDIDATES from env; then portable package paths.
# Prefer local ts-core / mon-env builds (schema-compatible) over stale system
# wrappers (e.g. /usr/local 1.3.x vs DB schema 29 from 1.6.x).
# shellcheck disable=SC2086
for c in ${WALLET_CLI_CANDIDATES:-} \
"${HOME}/.local/bin/taler-wallet-cli.mjs" \
"${HOME}/src/taler/taler-typescript-core/packages/taler-wallet-cli/bin/taler-wallet-cli.mjs" \
"${HOME}/src/taler/taler-typescript-core/packages/taler-wallet-cli/dist/taler-wallet-cli.mjs" \
"${HOME}/src/taler/taler-typescript-core/packages/taler-wallet-cli/dist/taler-wallet-cli-local.mjs" \
"${HOME}/src/taler/taler-typescript-core/packages/taler-wallet-cli/dist/taler-wallet-cli-bundled.cjs" \
/usr/lib/taler-wallet-cli/node_modules/taler-wallet-cli/bin/taler-wallet-cli.mjs \
/usr/share/taler-wallet-cli/bin/taler-wallet-cli.mjs
/usr/share/taler-wallet-cli/bin/taler-wallet-cli.mjs \
/usr/local/lib/taler-wallet-cli/node_modules/taler-wallet-cli/bin/taler-wallet-cli.mjs \
/usr/local/lib/taler-wallet-cli/node_modules/taler-wallet-cli/dist/taler-wallet-cli-bundled.cjs
do
[ -n "$c" ] && [ -f "$c" ] && { echo "$c"; return 0; }
done
@ -1533,6 +1541,14 @@ find_wallet_cli() {
c=$(readlink -f "$cand" 2>/dev/null || true)
[ -n "$c" ] && [ -f "$c" ] && { echo "$c"; return 0; }
fi
# macOS /usr/local wrapper often runs an older bundle; prefer its bundled.cjs only
# when no newer candidate above matched (already returned).
for c in \
/usr/local/lib/taler-wallet-cli/node_modules/taler-wallet-cli/dist/taler-wallet-cli-bundled.cjs \
/usr/local/lib/node_modules/taler-wallet-cli/dist/taler-wallet-cli-bundled.cjs
do
[ -f "$c" ] && { echo "$c"; return 0; }
done
fi
return 1
}