android: filter the wallet child's last_error where the SDK record becomes the model
All checks were successful
android-ci / android (pull_request) Successful in 12m53s
All checks were successful
android-ci / android (pull_request) Successful in 12m53s
The status line renders WalletChildInput.lastError through walletChildLine,
and the same field feeds walletChildStatusDescription for the screen reader.
The filter added in 3f84021 sat on the sticky error card only, so in exactly
the state this card targets — a live child with no wallet file open answering
-13 No wallet file — the raw daemon sentence still reached the line and the
screen-reader sentence.
Move it to the producer: WalletChildStatus.toInput() now runs lastError
through walletFailureText, the one seam where the SDK record becomes the
Kotlin model. Idempotent on its own replacement texts, so the error card's
second pass is stable.
New JVM tests build the SDK record and assert on the rendered line (and its
description), not on walletFailureText in isolation: with the filter removed
they fail on the raw 'No wallet file'.
This commit is contained in:
parent
3f84021abb
commit
b4f8bb809c
2 changed files with 96 additions and 1 deletions
|
|
@ -1130,6 +1130,17 @@ private fun CuprateModeButton(
|
|||
/**
|
||||
* The SDK record as the pure model `WalletChildStatusText.kt` renders. Field for
|
||||
* field, nothing inferred.
|
||||
*
|
||||
* `lastError` is the one field that is not verbatim. It is the core's
|
||||
* `wallet_status().last_error`, which is the *daemon's* own words on the path
|
||||
* this screen exists for: a live child with no wallet open answers `-13 No
|
||||
* wallet file`, and `parse_json_rpc` strips the envelope and keeps that bare
|
||||
* sentence. The status line renders this field — `walletChildLine`, and through
|
||||
* it `walletChildStatusDescription` for the screen reader — so the filter
|
||||
* belongs here, at the seam where the SDK record becomes the Kotlin model,
|
||||
* rather than at one of the render sites. `walletFailureText` is idempotent on
|
||||
* its own replacement texts, so the second pass on the sticky error card is
|
||||
* stable.
|
||||
*/
|
||||
internal fun WalletChildStatus.toInput(): WalletChildInput = WalletChildInput(
|
||||
state = state,
|
||||
|
|
@ -1141,7 +1152,7 @@ internal fun WalletChildStatus.toInput(): WalletChildInput = WalletChildInput(
|
|||
nodeState = nodeState,
|
||||
height = height,
|
||||
targetHeight = targetHeight,
|
||||
lastError = lastError,
|
||||
lastError = walletFailureText(lastError),
|
||||
)
|
||||
|
||||
/** Generate a QR bitmap for the given URI string. Returns null on encode failure. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue