feat(lightning): turn the group Lightning wallet on, on testnet3 (Phase 15)

GroupLightningRollout.ENABLED is now true. A Marmot group's screen offers
the Lightning wallet and the testnet3 onchain wallet it closes to, and
devices run the group nodes they are elected to. NIP-17 rooms still get
neither: they have no key to sign with. Mainnet is still refused by
GroupLightningRollout.allows, whatever a screen offers.

It was turned on before Phase 0's testnet3 measurement of how long the
LSP waits for a signature, so the 60-second signing deadline is a guess
until the first groups run there. The plan doc says so.

The wallet-row test now finds the onchain row by its title and status,
since the testnet3 row is also "Not opened yet". A new test checks that
the Lightning rows open the Lightning wallet and the testnet3 wallet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5.5 committed 2026-10-26 21:25:37 +02:00
1 parent 0939bd4c55
commit 5ff9380b03
3 files changed
+35 -5

No files matched your search

@@ -12,9 +12,12 @@ import fr.acinq.bitcoin.Chain
object GroupLightningRollout {
/**
* Whether the group's screen offers a Lightning wallet, and the test-network on-chain wallet it closes
* to. Lifts when Phases 0 to 12 are in, the JVM suite passes and a regtest end-to-end run passes.
* to, and whether this device runs the group nodes it is elected to. On, on testnet3 only: the phases
* are in, the JVM suite passes and the regtest end-to-end run passes. Phase 0's measurement of how
* long the LSP waits for a signature was still to be made on testnet3 when it was lifted, so the
* signing deadline is a guess until the first groups run there.
*/
const val ENABLED: Boolean = false
const val ENABLED: Boolean = true
/**
* The only network a Lightning wallet may be opened on. Iceberg says not to put money behind it, so
@@ -7,18 +7,22 @@ import androidx.compose.ui.test.ComposeUiTest
import androidx.compose.ui.test.ExperimentalTestApi
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.getBoundsInRoot
import androidx.compose.ui.test.hasText
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.runDesktopComposeUiTest
import com.machankura.bennu.compose.nostr.wallet.GroupWalletStatementEvent
import com.machankura.bennu.compose.repository.ChatRepository
import com.machankura.bennu.compose.repository.NostrRepository
import com.machankura.bennu.compose.ui.composable.GroupSignedWorkFixtures.activeUserPublicKey
import com.machankura.bennu.compose.ui.composable.GroupSignedWorkFixtures.chatRoomId
import com.machankura.bennu.compose.ui.composable.navigation.routes.GroupLightningWalletRoute
import com.machankura.bennu.compose.ui.composable.navigation.routes.GroupWalletRoute
import com.machankura.bennu.compose.ui.composable.navigation.routes.Route
import com.machankura.bennu.compose.ui.composable.widgets.ProvideSnackbarHost
import com.machankura.bennu.compose.ui.theme.BennuTheme
import com.machankura.bennu.compose.ui.view.state.ChatRoomDetailUIState
import com.machankura.bennu.compose.wallet.GroupLightningRollout
import com.machankura.bennu.compose.wallet.GroupWalletRollout
import kotlin.test.Test
import kotlin.test.assertEquals
@@ -53,13 +57,36 @@ class GroupSignedWorkRowsJvmTest {
var opened: Route? = null
render(state(), onNavigateToRoute = { opened = it }) {
onNodeWithText("Not opened yet").assertIsDisplayed()
// This row's own status: the testnet3 wallet's row, below it, says the same of its wallet.
onNode(hasText(WALLET_ROW) and hasText("Not opened yet")).assertIsDisplayed()
onNodeWithText(WALLET_ROW).performClick()
}
assertEquals(GroupWalletRoute(activeUserPublicKey, chatRoomId, relayHint = null), opened)
}
@Test
fun `the Lightning wallet's rows open it, and the testnet3 wallet it closes to`() {
if (!GroupWalletRollout.ENABLED || !GroupLightningRollout.ENABLED) return
val network = GroupWalletStatementEvent.chainName(GroupLightningRollout.NETWORK)
val opened = mutableListOf<Route>()
render(state(), onNavigateToRoute = { opened += it }) {
onNode(hasText("Lightning wallet") and hasText(network)).assertIsDisplayed()
onNode(hasText("Group onchain wallet on $network") and hasText("Not opened yet")).assertIsDisplayed()
onNodeWithText("Lightning wallet").performClick()
onNodeWithText("Group onchain wallet on $network").performClick()
}
assertEquals(
listOf(
GroupLightningWalletRoute(activeUserPublicKey, chatRoomId),
GroupWalletRoute(activeUserPublicKey, chatRoomId, relayHint = null, chain = network),
),
opened,
)
}
@Test
fun `the group's screen has no nostr profile, relays, posts or paste`() = render(state()) {
onNodeWithText("Nostr profile").assertDoesNotExist()