Commit 60f69d0
Vladimir Rogojin
fix(cli)(sphere-sdk#282): route
Residual #2 of the §D `manual-test-full-recovery.sh` ALL GREEN
campaign. The `sphere wallet use <name>` subcommand printed its
confirmation lines
✓ Switched to wallet profile: <name>
Nametag: <tag>
L1 Addr: <alpha1...>
via `console.log` (stdout). The harness captures `sphere balance >
file` snapshots; some snapshot blocks bracket the `wallet use`
invocation outside the redirect (peer2: `sphere wallet use alice ;
sphere balance > file`), others inside a subshell (peer1: `( …
sphere wallet use alice && sphere balance ) > file`). The two
flows yield different captured-stdout content for the same logical
operation, so the resulting peer1-vs-peer2 diff failed assertion
even though both wallets had identical balances.
Fix: route the entire confirmation block (success and `(wallet not
initialized in this profile)` fallback) through `console.error`.
Errors (usage hint, profile-not-found) were already on stderr, so
this brings the success path in line with them. Behaviour for human
operators is unchanged — terminal sessions still see the banner;
only `>` / `|` stdout pipelines are now unaffected by it.
Side-benefit: any future shell tooling that pipes
`sphere wallet use <name> | …` no longer has to filter the banner
out of the consumed stream.
Tests
* `test/integration/cli-wallet-profile.integration.test.ts` —
the "`wallet use alice` switches the active profile" assertion
now expects the banner on `r.stderr` (with a negative match on
`r.stdout`) per the new contract.
* Full integration suite: 25 / 25 passed.
* Full default unit suite: 119 / 119 passed.
Refs sphere-sdk#282wallet use confirmation to STDERR1 parent e73ddb7 commit 60f69d0
2 files changed
Lines changed: 19 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1982 | 1982 | | |
1983 | 1983 | | |
1984 | 1984 | | |
1985 | | - | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
1986 | 1996 | | |
1987 | 1997 | | |
1988 | 1998 | | |
1989 | 1999 | | |
1990 | 2000 | | |
1991 | 2001 | | |
1992 | | - | |
1993 | | - | |
| 2002 | + | |
| 2003 | + | |
1994 | 2004 | | |
1995 | 2005 | | |
1996 | 2006 | | |
1997 | | - | |
| 2007 | + | |
1998 | 2008 | | |
1999 | 2009 | | |
2000 | 2010 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
0 commit comments