android: block the wallet screen on an unbacked seed, and make it re-showable
All checks were successful
android-ci / android (pull_request) Successful in 10m39s

A created wallet's seed was two lines of small text at the bottom of the
wallet page, dismissed by one tap, gone for good once the screen was left.
A real user created a wallet, never saw the seed, and the app had no way to
show it again.

- `SeedBackupGate` (new, pure Kotlin): the confirm word `SEEN` and its
  case-insensitive match mirror the TUI's own `WalletSetup::CreateSeed`
  gate; create starts unbacked, import is backed up without the gate, and
  only a correct word can confirm.
- The seed card is the whole body until the word is typed and Done is
  tapped: no Cancel, no copy button (the Android clipboard is readable by
  every other app), Done dead until `SEEN`.
- "Back up seed" re-reads the seed through the new `Wire::wallet_seed()`
  (`WireViewModel.walletSeed()`), so a seed missed the first time is not
  lost. Its failure is shown next to the button, not at the bottom of a
  long scroll.
- While unconfirmed: a warning strip stays at the top of the wallet screen
  and the receive address and Show QR are hidden — XMR received into a
  wallet whose 25 words were never written down is unrecoverable.
- The flag lives in app-local prefs (`wallet_seed_backup`), not in the
  Keystore-wrapped store, and is reset by `createWallet` itself so no
  caller can forget it. An install that predates the flag reads as
  unconfirmed: "we never asked" is not "the user wrote it down", and
  "Back up seed" is the way out.

The app-bar Back still leaves the screen, deliberately — it is the TUI's
`Esc`. It costs nothing now, because leaving no longer loses the seed.

Verification: `./gradlew :app:testDebugUnitTest` green, 132 tests
(`SeedBackupGateTest` 15 of them).
This commit is contained in:
agent 2026-09-20 12:09:48 -04:00
commit 3431a9eda9
No known key found for this signature in database
4 changed files with 512 additions and 17 deletions

View file

@ -1,6 +1,8 @@
package com.siriusdevops.onionwire
import android.app.Application
import android.content.Context
import android.content.SharedPreferences
import androidx.core.app.NotificationManagerCompat
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.viewModelScope
@ -11,6 +13,8 @@ import com.siriusdevops.onionwire.crypto.StoredPassphraseStore
import com.siriusdevops.onionwire.keepalive.KeepAliveService
import com.siriusdevops.onionwire.keepalive.KeepAliveStatus
import com.siriusdevops.onionwire.keepalive.NodeHost
import com.siriusdevops.onionwire.ui.SeedBackupGate
import com.siriusdevops.onionwire.ui.WalletKeyOrigin
import com.siriusdevops.onionwire.wallet.ChainStorage
import com.siriusdevops.onionwire.wallet.NO_WALLET_RPC_MESSAGE
import com.siriusdevops.onionwire.wallet.WalletChildBinaries
@ -588,11 +592,32 @@ class WireViewModel(app: Application) : AndroidViewModel(app) {
suspend fun sendTip(pubkeyHex: String, amountXmr: String, memo: String = ""): Result<Unit> =
runCatching { requireWire().sendTip(pubkeyHex, amountXmr, memo) }
/**
* Create a wallet and read its seed once. The seed-backup flag is reset
* here, not by the screen: every successful create is a new seed nobody has
* read, and a caller that forgot to reset it would leave a spend key
* unrecoverable. See [SeedBackupGate.afterWallet].
*/
suspend fun createWallet(password: String): Result<String> =
runCatching { requireWire().createWallet(password) }
.onSuccess { setWalletSeedBackedUp(SeedBackupGate.afterWallet(WalletKeyOrigin.Created)) }
/**
* Import a wallet from a user-supplied seed. That seed is already on paper —
* the user just pasted it — so the wallet counts as backed up without the
* confirm step.
*/
suspend fun importWallet(password: String, seed: String): Result<Unit> =
runCatching { requireWire().importWallet(password, seed) }
.onSuccess { setWalletSeedBackedUp(SeedBackupGate.afterWallet(WalletKeyOrigin.Imported)) }
/**
* Re-read the open wallet's 25-word seed, for the "Back up seed" recovery
* path. A spend key: only ever called from that explicit user action, shown
* on the blocking card, and dropped. Never logged and never persisted.
*/
suspend fun walletSeed(): Result<String> =
runCatching { requireWire().walletSeed() }
fun spendAuthorityWarning(): String = runCatching {
requireWire().spendAuthorityWarning()
@ -600,6 +625,39 @@ class WireViewModel(app: Application) : AndroidViewModel(app) {
"this wallet file can spend. anyone with its passphrase or the RPC creds can move the balance. write down the seed."
}
// --- Seed backup gate --------------------------------------------------
// Whether the open wallet's seed has been confirmed written down. This is
// NOT a secret — it is a boolean in app-local prefs, deliberately kept out
// of the Keystore-wrapped store under `filesDir/secrets`, which holds the
// passphrase and nothing else.
//
// An install that predates this flag reads as unconfirmed rather than
// silently backed up: "we never asked" is not "the user wrote it down", and
// the screen's `Back up seed` action is the path out of it.
private val seedBackupPrefs: SharedPreferences =
app.getSharedPreferences(SEED_BACKUP_PREFS, Context.MODE_PRIVATE)
private val _walletSeedBackedUp = MutableStateFlow(
seedBackupPrefs.getBoolean(SEED_BACKED_UP_KEY, false),
)
/** True once the open wallet's seed has been confirmed written down. */
val walletSeedBackedUp: StateFlow<Boolean> = _walletSeedBackedUp.asStateFlow()
/**
* One confirm step from the blocking seed card. The gate decides: a wrong
* word leaves the flag where it was, so this can never un-confirm a wallet.
*/
fun confirmWalletSeed(typed: String) {
setWalletSeedBackedUp(SeedBackupGate.afterConfirm(typed, _walletSeedBackedUp.value))
}
private fun setWalletSeedBackedUp(backedUp: Boolean) {
seedBackupPrefs.edit().putBoolean(SEED_BACKED_UP_KEY, backedUp).apply()
_walletSeedBackedUp.value = backedUp
}
// --- App-owned wallet child (issue #107) -------------------------------
// The app owns `monero-wallet-rpc` instead of asking the user to start one
// and export `ONIONWIRE_WALLET_RPC`. The core's own states are surfaced
@ -920,3 +978,13 @@ suspend fun walletChildRefreshLoop(
/** Cadence of the wallet-child refresh loop, in milliseconds. */
private const val WALLET_CHILD_TICK_MS: Long = 2_000
/**
* App-local prefs file for the seed-backup flag. Not a secret, so it is a plain
* prefs file rather than anything under `filesDir/secrets`.
*/
private const val SEED_BACKUP_PREFS: String = "wallet_seed_backup"
/** Key inside [SEED_BACKUP_PREFS]: has the open wallet's seed been written down? */
private const val SEED_BACKED_UP_KEY: String = "backed_up"

View file

@ -0,0 +1,89 @@
package com.siriusdevops.onionwire.ui
/**
* Where the open wallet's key material came from.
*
* The distinction is the whole gate. A seed the user *supplied* (import) is a
* seed the user already has on paper, so that wallet is backed up from the
* start. A seed the app *generated* (create) has been read by nobody until it
* is put on screen, so that wallet starts unbacked and stays unbacked until the
* user proves it is written down.
*/
enum class WalletKeyOrigin {
Created,
Imported,
}
/**
* The seed-backup gate: every decision the wallet screen makes about an
* unconfirmed seed, as pure Kotlin — no Compose, no Android, no prefs — so the
* rules are covered by `SeedBackupGateTest` on the JVM without a device.
*
* The gate exists because a seed shown once and then lost is an unrecoverable
* wallet: XMR received into a wallet whose 25 words were never written down
* cannot be spent or recovered by anyone, including this app. So the flag is
* not advisory — while it is `false` the wallet screen keeps a warning up and
* hides the receive address and its QR.
*
* The confirm word and its case-insensitivity mirror the TUI's own seed screen
* (`src/tui.rs`, `WalletSetup::CreateSeed`, which compares with
* `eq_ignore_ascii_case("SEEN")`) instead of inventing a second convention for
* the same wallet.
*/
object SeedBackupGate {
/** The word that releases the block. The TUI's word, not a new one. */
const val CONFIRM_WORD: String = "SEEN"
/**
* True when [typed] releases the block.
*
* Trimmed and case-insensitive, so a soft keyboard's auto-capitalised `Seen`
* and a trailing space from a paste both count. Everything else — including
* the empty string — stays blocked.
*/
fun accepts(typed: String): Boolean =
typed.trim().equals(CONFIRM_WORD, ignoreCase = true)
/**
* The flag right after a wallet is created or imported.
*
* A create always resets it: the wallet file is new, and the seed it was
* built from has never been read by anyone.
*/
fun afterWallet(origin: WalletKeyOrigin): Boolean = when (origin) {
WalletKeyOrigin.Created -> false
WalletKeyOrigin.Imported -> true
}
/**
* The flag after one confirm step.
*
* Only a correct [typed] can flip it to `true`; a wrong word can never
* un-confirm a wallet that is already backed up.
*/
fun afterConfirm(typed: String, backedUp: Boolean): Boolean =
backedUp || accepts(typed)
/** Done is dead until the word is right. */
fun confirmEnabled(typed: String): Boolean = accepts(typed)
/** The persistent strip is up exactly while the seed is unconfirmed. */
fun warningVisible(backedUp: Boolean): Boolean = !backedUp
/**
* The receive address and its QR are shown only once the seed is confirmed.
* Receiving into an unbacked wallet is the one mistake this gate exists to
* prevent, so it is hidden rather than merely warned about.
*/
fun receiveAddressVisible(backedUp: Boolean): Boolean = backedUp
/**
* The strip's words. One source: the screen renders this verbatim, so the
* reason the address disappeared travels with the hiding.
*/
const val WARNING: String =
"seed not backed up. write down the 25 words before you receive anything — " +
"a wallet whose seed was never written down cannot be recovered. " +
"the receive address stays hidden until you do."
}

View file

@ -76,6 +76,7 @@ fun WalletScreen(
val childError by vm.walletChildError.collectAsStateWithLifecycle()
val starting by vm.walletChildStarting.collectAsStateWithLifecycle()
val chain by vm.chainSource.collectAsStateWithLifecycle()
val backedUp by vm.walletSeedBackedUp.collectAsStateWithLifecycle()
val scope = rememberCoroutineScope()
// Resolved once per composition: the native library directory is fixed for
// the life of the process.
@ -92,7 +93,11 @@ fun WalletScreen(
var error by remember { mutableStateOf<String?>(null) }
var composer by remember { mutableStateOf<PayKind?>(null) }
var setup by remember { mutableStateOf<SetupKind?>(null) }
var backupSeed by remember { mutableStateOf<String?>(null) }
// The seed currently on the blocking card: set by a successful create, or by
// "Back up seed" re-reading it from the wallet child. Null means no card.
// Never persisted and never logged — it is a spend key.
var pendingSeed by remember { mutableStateOf<String?>(null) }
var seedConfirm by remember { mutableStateOf("") }
var daemonText by remember { mutableStateOf("") }
var daemonError by remember { mutableStateOf<String?>(null) }
@ -103,6 +108,26 @@ fun WalletScreen(
runCatching { transfers = vm.walletRecentTransfers(25) }
}
/**
* "Back up seed": re-read the open wallet's seed from the wallet child and
* put it on the blocking card. This is the only path to a seed that was
* created before this screen existed, so the failure is shown rather than
* swallowed — it is the difference between "the child is not running" and
* "there is nothing to recover".
*/
fun openSeedBackup() {
scope.launch {
error = null
vm.walletSeed().fold(
onSuccess = { seed ->
pendingSeed = seed
seedConfirm = ""
},
onFailure = { error = it.message ?: it.toString() },
)
}
}
LaunchedEffect(Unit) {
reload()
vm.refreshChainSource()
@ -151,6 +176,42 @@ fun WalletScreen(
.screenContentInsets()
.verticalScroll(rememberScrollState()),
) {
// The blocking seed step. While a seed is on screen this card is the
// whole body: no Cancel, and Done stays dead until the confirm word
// is typed, so the one-shot seed cannot be dismissed unread. The
// app-bar Back still leaves the screen — that is the TUI's `Esc` —
// and it costs nothing now, because leaving no longer loses the
// seed: the wallet stays unbacked (strip up, receive address hidden)
// until "Back up seed" puts this card back on screen.
val seed = pendingSeed
if (seed != null) {
SeedBackupCard(
seed = seed,
typed = seedConfirm,
onTyped = { seedConfirm = it },
onDone = {
// The gate owns the transition: a wrong word (which the
// disabled Done button already blocks) cannot confirm.
vm.confirmWalletSeed(seedConfirm)
pendingSeed = null
seedConfirm = ""
},
)
error?.let { ErrorLine(it) }
return@Column
}
// The persistent unbacked strip, above everything else on the page.
// `walletOpen` is the core's own "configured" signal — `wallet_balance`
// returns exactly "off" for a wallet the child has not configured —
// so a fresh install with no wallet is not nagged about a seed it
// does not have.
val walletOpen = balance != null && balance != "off"
val unbacked = walletOpen && SeedBackupGate.warningVisible(backedUp)
if (unbacked) {
UnbackedSeedCard(error = error, onBackUpSeed = { openSeedBackup() })
}
Card(
modifier = Modifier
.fillMaxWidth()
@ -173,7 +234,10 @@ fun WalletScreen(
style = MaterialTheme.typography.headlineSmall,
fontFamily = FontFamily.Monospace,
)
val addr = address
// Hidden until the seed is confirmed written down: XMR into a
// wallet whose 25 words were never recorded is unrecoverable,
// so the address and its QR are gated, not just warned about.
val addr = address?.takeIf { SeedBackupGate.receiveAddressVisible(backedUp) }
if (addr != null) {
Spacer(Modifier.height(8.dp))
Text(
@ -333,7 +397,9 @@ fun WalletScreen(
onCancel = { setup = null },
onCreated = { seed ->
setup = null
backupSeed = seed
// The card is the whole body from here until SEEN.
pendingSeed = seed
seedConfirm = ""
scope.launch { reload() }
},
onImported = {
@ -374,36 +440,167 @@ fun WalletScreen(
modifier = Modifier.weight(1f),
) { Text("Import") }
}
// The recovery path for a wallet whose seed was missed. The
// strip above carries its own copy of this button while the
// seed is unconfirmed, so exactly one is ever on screen.
if (walletOpen && !SeedBackupGate.warningVisible(backedUp)) {
Spacer(Modifier.height(8.dp))
OutlinedButton(
onClick = { openSeedBackup() },
modifier = Modifier
.fillMaxWidth()
.testTag("wallet-seed-backup-action"),
) { Text("Back up seed") }
}
}
}
backupSeed?.let { seed ->
Text(
"write this seed down once. anyone with it can spend.",
style = MaterialTheme.typography.labelSmall,
modifier = Modifier.padding(horizontal = 12.dp),
)
Text(
seed,
style = MaterialTheme.typography.bodySmall,
fontFamily = FontFamily.Monospace,
modifier = Modifier.padding(horizontal = 12.dp, vertical = 4.dp),
)
TextButton(onClick = { backupSeed = null }) { Text("I wrote it down") }
// While the strip is up the error belongs next to the button that
// caused it: this page is one long scroll and the daemon card sits
// between the strip and the bottom, so a failed `wallet_seed` read
// would otherwise land off-screen.
if (!unbacked) {
error?.let { ErrorLine(it) }
}
}
}
}
/** The one error line every wallet action shares. */
@Composable
private fun ErrorLine(text: String) {
Text(
text,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.error,
modifier = Modifier.padding(horizontal = 12.dp, vertical = 4.dp),
)
}
/**
* The persistent unbacked strip: up at the top of the wallet screen from the
* moment a create succeeds until the seed is confirmed written down, and again
* on any install whose wallet predates the flag.
*
* It is not a toast and not a dialog — leaving the screen does not dismiss it,
* because the state it reports is the wallet's, not the screen's. Its button is
* the recovery path for a seed that was created before the user knew to look.
*/
@Composable
private fun UnbackedSeedCard(
error: String?,
onBackUpSeed: () -> Unit,
) {
Card(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 12.dp, vertical = 8.dp)
.testTag("wallet-seed-warning"),
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.errorContainer,
),
) {
Column(Modifier.padding(12.dp)) {
Text(
SeedBackupGate.WARNING,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onErrorContainer,
)
Spacer(Modifier.height(8.dp))
OutlinedButton(
onClick = onBackUpSeed,
modifier = Modifier
.fillMaxWidth()
.testTag("wallet-seed-backup-action"),
) { Text("Back up seed") }
error?.let {
Spacer(Modifier.height(6.dp))
Text(
it,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.error,
modifier = Modifier.padding(horizontal = 12.dp, vertical = 4.dp),
)
}
}
}
}
/**
* The blocking seed step: the 25 words, and a Done that is dead until the
* confirm word is typed.
*
* There is no Cancel and no copy button. No Cancel, because a seed this card is
* showing for the first time has never been written down anywhere else, so
* dismissing it unread is how a wallet becomes unrecoverable. No copy button,
* because the Android clipboard is readable by every other app on the device
* (and by the clipboard history on Android 13+), which would hand the spend key
* to whoever asks for it next.
*
* The seed is a Kotlin `String`, so it cannot be wiped in place the way the
* TUI's `Zeroizing<String>` is; dropping the reference is the strongest thing
* available here. That is another reason it is never written to disk.
*/
@Composable
private fun SeedBackupCard(
seed: String,
typed: String,
onTyped: (String) -> Unit,
onDone: () -> Unit,
) {
Card(
modifier = Modifier
.fillMaxWidth()
.padding(12.dp)
.testTag("wallet-seed-card"),
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.surfaceVariant,
),
) {
Column(Modifier.padding(12.dp)) {
Text("Back up this seed", style = MaterialTheme.typography.titleSmall)
Spacer(Modifier.height(8.dp))
Text(
"These 25 words are the only way to recover this wallet, and anyone who " +
"reads them can spend it. Write them down now — this is the only copy.",
style = MaterialTheme.typography.bodySmall,
)
Spacer(Modifier.height(8.dp))
Text(
seed,
style = MaterialTheme.typography.bodyMedium,
fontFamily = FontFamily.Monospace,
modifier = Modifier
.fillMaxWidth()
.testTag("wallet-seed-words"),
)
Spacer(Modifier.height(12.dp))
Text(
"Type ${SeedBackupGate.CONFIRM_WORD} to confirm you have written it down.",
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Spacer(Modifier.height(4.dp))
OutlinedTextField(
value = typed,
onValueChange = onTyped,
singleLine = true,
label = { Text("type ${SeedBackupGate.CONFIRM_WORD}") },
modifier = Modifier
.fillMaxWidth()
.testTag("wallet-seed-confirm-input"),
)
Spacer(Modifier.height(8.dp))
Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End) {
Button(
onClick = onDone,
enabled = SeedBackupGate.confirmEnabled(typed),
modifier = Modifier.testTag("wallet-seed-confirm-done"),
) { Text("Done") }
}
}
}
}
@Composable
private fun TransferCard(t: TransferRow) {
Card(

View file

@ -0,0 +1,141 @@
package com.siriusdevops.onionwire.ui
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
/**
* The seed-backup gate's rules, on the JVM.
*
* These are the decisions the wallet screen renders from: whether the created
* seed card is still blocking, whether the persistent warning is up, and
* whether the receive address is on screen at all. Pure logic, so no
* Robolectric and no Compose test dependency — same shape as
* `WalletChildStatusTextTest` and `OutboxDetailTest`.
*/
class SeedBackupGateTest {
// --- the confirm word is the TUI's word ---------------------------------
@Test
fun the_confirm_word_is_the_tui_word() {
// `src/tui.rs` `WalletSetup::CreateSeed` compares against "SEEN". A
// second convention here would be a different gate than the TUI's.
assertEquals("SEEN", SeedBackupGate.CONFIRM_WORD)
}
@Test
fun a_correct_word_releases_the_block_whatever_its_case_or_padding() {
assertTrue(SeedBackupGate.accepts("SEEN"))
// The TUI compares with `eq_ignore_ascii_case`.
assertTrue(SeedBackupGate.accepts("seen"))
assertTrue(SeedBackupGate.accepts("SeEn"))
// A soft keyboard auto-capitalises and a paste can carry whitespace.
assertTrue(SeedBackupGate.accepts(" seen "))
}
@Test
fun a_blank_or_wrong_word_stays_blocked() {
assertFalse(SeedBackupGate.accepts(""))
assertFalse(SeedBackupGate.accepts(" "))
assertFalse(SeedBackupGate.accepts("SEE"))
// A prefix is not the word: the TUI only fires on the whole match.
assertFalse(SeedBackupGate.accepts("SEENN"))
assertFalse(SeedBackupGate.accepts("seen."))
// The other word in this flow is the spend-authority one.
assertFalse(SeedBackupGate.accepts("SPEND"))
}
@Test
fun done_is_dead_until_the_word_is_right() {
assertFalse(SeedBackupGate.confirmEnabled(""))
assertFalse(SeedBackupGate.confirmEnabled("SEENN"))
assertTrue(SeedBackupGate.confirmEnabled("SEEN"))
assertTrue(SeedBackupGate.confirmEnabled("seen"))
}
// --- the state transitions ----------------------------------------------
@Test
fun a_create_starts_unbacked() {
assertFalse(SeedBackupGate.afterWallet(WalletKeyOrigin.Created))
}
@Test
fun an_import_is_backed_up_without_the_gate() {
// The user pasted the seed to get here, so there is nothing to confirm.
assertTrue(SeedBackupGate.afterWallet(WalletKeyOrigin.Imported))
}
@Test
fun a_successful_confirm_marks_the_wallet_backed_up() {
val created = SeedBackupGate.afterWallet(WalletKeyOrigin.Created)
assertTrue(SeedBackupGate.afterConfirm("SEEN", created))
}
@Test
fun a_wrong_word_leaves_an_unbacked_wallet_unbacked() {
assertFalse(SeedBackupGate.afterConfirm("", false))
assertFalse(SeedBackupGate.afterConfirm("nope", false))
}
@Test
fun a_wrong_word_cannot_un_confirm_a_backed_up_wallet() {
// Done is disabled for a wrong word, but the flag must not be a way to
// walk a confirmed wallet back into the hidden-address state.
assertTrue(SeedBackupGate.afterConfirm("", true))
assertTrue(SeedBackupGate.afterConfirm("SPEND", true))
}
@Test
fun a_new_create_resets_a_confirmed_wallet_to_unbacked() {
// Create -> confirm -> create again: the second wallet file has its own
// seed, and nobody has read it yet.
val first = SeedBackupGate.afterConfirm("SEEN", SeedBackupGate.afterWallet(WalletKeyOrigin.Created))
assertTrue(first)
assertFalse(SeedBackupGate.afterWallet(WalletKeyOrigin.Created))
}
// --- what the screen does with the flag ---------------------------------
@Test
fun the_warning_strip_is_up_only_while_the_seed_is_unconfirmed() {
assertTrue(SeedBackupGate.warningVisible(false))
assertFalse(SeedBackupGate.warningVisible(true))
}
@Test
fun the_receive_address_is_hidden_while_the_seed_is_unconfirmed() {
assertFalse(SeedBackupGate.receiveAddressVisible(false))
assertTrue(SeedBackupGate.receiveAddressVisible(true))
}
@Test
fun an_imported_wallet_keeps_its_receive_address_and_loses_the_strip() {
val backedUp = SeedBackupGate.afterWallet(WalletKeyOrigin.Imported)
assertTrue(SeedBackupGate.receiveAddressVisible(backedUp))
assertFalse(SeedBackupGate.warningVisible(backedUp))
}
@Test
fun a_created_wallet_hides_its_receive_address_until_the_word_is_typed() {
val created = SeedBackupGate.afterWallet(WalletKeyOrigin.Created)
assertFalse(SeedBackupGate.receiveAddressVisible(created))
assertTrue(SeedBackupGate.warningVisible(created))
val confirmed = SeedBackupGate.afterConfirm("seen", created)
assertTrue(SeedBackupGate.receiveAddressVisible(confirmed))
assertFalse(SeedBackupGate.warningVisible(confirmed))
}
@Test
fun the_strip_says_why_the_address_is_gone() {
// The hiding is only fair if the strip names it; assert the strip is
// not empty and actually mentions the seed and the receive address.
val text = SeedBackupGate.WARNING
assertTrue(text.contains("seed"))
assertTrue(text.contains("receive address"))
assertTrue(text.contains("recovered"))
}
}