feat(subgroup): the picker chooses the parent's own guardian delay, and the join gate says it (Phase 5)
Under the guarded row, SelectSubgroupAdminsScreen offers the delay for this group's own leaf: presets for an hour, two (the default), a day, a week, a month, six months and the longest, and a custom field in blocks whose supporting text says what it works out to, or why it cannot be used. The view model keeps what was typed rather than clamping it, refusal() refuses a delay outside 6..65,535 for a guarded subgroup, a retry restores it, and confirm passes it to proposeRitual. The guarded row and the join gate stop quoting 12. Lands with Phase 6, which puts the chosen delay into the certificate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fbfe9075f2
commit
b58a757a44
5 files changed
+272
-9
No files matched your search
@@ -554,12 +554,12 @@
|
||||
<string name="the_subgroup_s_wallet">The subgroup's wallet</string>
|
||||
<string name="guarded_wallet">Guarded wallet</string>
|
||||
<string name="unguarded_wallet">Unguarded wallet</string>
|
||||
<string name="this_group_can_spend_its_coins_once">This group can spend any coin in it once it has %1$d confirmations.</string>
|
||||
<string name="this_group_and_the_d_above_it_can_spend">This group and the %1$d above it can spend any coin in it once it has %2$d confirmations.</string>
|
||||
<string name="this_group_can_spend_its_coins_once">This group can spend any coin in it once it has waited as long as the delay below.</string>
|
||||
<string name="this_group_and_the_d_above_it_can_spend">This group, after the delay below, and the %1$d above it, after the delays they chose, can spend any coin in it.</string>
|
||||
<string name="only_the_subgroup_can_spend_from_its_wallet">Only the subgroup can spend from its wallet. Groups above it can't reach it or anything beneath it.</string>
|
||||
<string name="this_group_is_guarded_so_its_subgroups_are_too">This group is guarded, so its subgroups are too.</string>
|
||||
<string name="this_group_s_guardian_keys_can_t_be_read">This group's own guardian keys can't be read, so it can't guard a subgroup.</string>
|
||||
<string name="the_subgroup_s_wallet_will_be_guarded">The subgroup's wallet will be guarded: this group, and every group above it, can spend any coin in it once it has %1$d confirmations.</string>
|
||||
<string name="the_subgroup_s_wallet_will_be_guarded">The subgroup's wallet will be guarded: this group can spend any coin in it once it has waited %1$s, and each group above it after the delay it chose.</string>
|
||||
<string name="the_subgroup_s_wallet_will_not_be_guarded">The subgroup's wallet will not be guarded: only the subgroup can spend from it.</string>
|
||||
<string name="the_group_above_decided_this_wallet_is_guarded">The group above this one decided this group's wallet is guarded. Each group above it can spend any coin in it that has waited as long as its own delay, without this group agreeing:</string>
|
||||
<string name="the_group_above_decided_this_wallet_is_not_guarded">The group above this one decided this group's wallet is not guarded. Only this group can spend from it.</string>
|
||||
@@ -567,6 +567,17 @@
|
||||
<!-- A guardian's delay in blocks and roughly in time: docs/guardian-delay.md, D5 -->
|
||||
<string name="blocks_and_about">%1$s, %2$s</string>
|
||||
<string name="guardian_after">%1$s: after %2$s</string>
|
||||
<string name="how_long_before_this_group_can_spend_a_coin">How long before this group can spend a coin</string>
|
||||
<string name="delay_one_hour">1 hour</string>
|
||||
<string name="delay_two_hours">2 hours</string>
|
||||
<string name="delay_one_day">1 day</string>
|
||||
<string name="delay_one_week">1 week</string>
|
||||
<string name="delay_one_month">1 month</string>
|
||||
<string name="delay_six_months">6 months</string>
|
||||
<string name="delay_longest">Longest</string>
|
||||
<string name="delay_custom">Custom</string>
|
||||
<string name="delay_in_blocks">Delay in blocks</string>
|
||||
<string name="a_coin_the_subgroup_moves_starts_waiting_again">A coin the subgroup moves starts waiting again, so a long delay lets it keep its coins out of reach by moving them.</string>
|
||||
<string name="a_group_above_this_one">A group above this one</string>
|
||||
<string name="this_group_s_delay_in_this_wallet">This group can spend a coin here after %1$s</string>
|
||||
<string name="guarded_wallet_after">Guarded wallet, after %1$s</string>
|
||||
|
||||
+6
-1
@@ -1,5 +1,6 @@
|
||||
package com.machankura.bennu.compose.ui.composable
|
||||
|
||||
import com.machankura.bennu.compose.ui.composable.widgets.delayText
|
||||
import com.machankura.bennu.compose.nostr.subgroup.SubgroupWalletPolicy
|
||||
import com.machankura.bennu.compose.managers.GuardianDerivation
|
||||
import com.machankura.bennu.compose.database.model.subgroupWalletPolicy
|
||||
@@ -73,9 +74,13 @@ fun DkgJoinApprovalScreen(
|
||||
session.subgroupWalletPolicy?.let { policy ->
|
||||
Text(
|
||||
text = when (policy) {
|
||||
// The parent's own leaf's delay, as the coordinator chose it --
|
||||
// or the default an older build's ceremony is certified at.
|
||||
// An inherited ancestor's is not here: a member deciding
|
||||
// whether to join cannot check it. docs/guardian-delay.md.
|
||||
SubgroupWalletPolicy.GUARDED -> stringResource(
|
||||
Res.string.the_subgroup_s_wallet_will_be_guarded,
|
||||
GuardianDerivation.DEFAULT_DELAY.toInt()
|
||||
delayText(session.guardianDelay ?: GuardianDerivation.DEFAULT_DELAY)
|
||||
)
|
||||
SubgroupWalletPolicy.UNGUARDED -> stringResource(Res.string.the_subgroup_s_wallet_will_not_be_guarded)
|
||||
},
|
||||
|
||||
+110
-4
@@ -1,9 +1,25 @@
|
||||
package com.machankura.bennu.compose.ui.composable
|
||||
|
||||
import bennu.composeapp.generated.resources.a_coin_the_subgroup_moves_starts_waiting_again
|
||||
import bennu.composeapp.generated.resources.delay_in_blocks
|
||||
import bennu.composeapp.generated.resources.delay_custom
|
||||
import bennu.composeapp.generated.resources.delay_longest
|
||||
import bennu.composeapp.generated.resources.delay_six_months
|
||||
import bennu.composeapp.generated.resources.delay_one_month
|
||||
import bennu.composeapp.generated.resources.delay_one_week
|
||||
import bennu.composeapp.generated.resources.delay_one_day
|
||||
import bennu.composeapp.generated.resources.delay_two_hours
|
||||
import bennu.composeapp.generated.resources.delay_one_hour
|
||||
import bennu.composeapp.generated.resources.how_long_before_this_group_can_spend_a_coin
|
||||
import com.machankura.bennu.compose.ui.composable.widgets.delayText
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.material3.FilterChip
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.foundation.layout.FlowRow
|
||||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||
import com.machankura.bennu.compose.ui.view.state.onlyGuarded
|
||||
import com.machankura.bennu.compose.ui.view.state.canGuard
|
||||
import com.machankura.bennu.compose.nostr.subgroup.SubgroupWalletPolicy
|
||||
import com.machankura.bennu.compose.managers.GuardianDerivation
|
||||
import bennu.composeapp.generated.resources.this_group_s_guardian_keys_can_t_be_read
|
||||
import bennu.composeapp.generated.resources.this_group_is_guarded_so_its_subgroups_are_too
|
||||
import bennu.composeapp.generated.resources.only_the_subgroup_can_spend_from_its_wallet
|
||||
@@ -303,6 +319,22 @@ fun SelectSubgroupAdminsScreen(
|
||||
onPolicyChange = viewModel::setWalletPolicy
|
||||
)
|
||||
}
|
||||
|
||||
// The parent's own leaf's delay, and only for a guarded
|
||||
// subgroup: docs/guardian-delay.md.
|
||||
if (viewModel.walletPolicy.value == SubgroupWalletPolicy.GUARDED && state.canGuard) {
|
||||
item {
|
||||
GuardianDelayChooser(
|
||||
input = viewModel.guardianDelayInput.value,
|
||||
delay = viewModel.guardianDelay(),
|
||||
isCustom = viewModel.isCustomDelay.value,
|
||||
problem = viewModel.guardianDelayProblem(),
|
||||
onPreset = viewModel::setGuardianDelay,
|
||||
onCustom = viewModel::useCustomDelay,
|
||||
onInput = viewModel::setGuardianDelayInput,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,7 +424,6 @@ private fun WalletPolicyChooser(
|
||||
style = MaterialTheme.typography.titleSmall
|
||||
)
|
||||
|
||||
val delay = GuardianDerivation.DEFAULT_DELAY.toInt()
|
||||
WalletPolicyRow(
|
||||
title = stringResource(Res.string.guarded_wallet),
|
||||
// Names the reach the parent is actually granting: itself, and each
|
||||
@@ -400,9 +431,9 @@ private fun WalletPolicyChooser(
|
||||
description = if (!canGuard) {
|
||||
stringResource(Res.string.this_group_s_guardian_keys_can_t_be_read)
|
||||
} else if (parentGuardianCount == 0) {
|
||||
stringResource(Res.string.this_group_can_spend_its_coins_once, delay)
|
||||
stringResource(Res.string.this_group_can_spend_its_coins_once)
|
||||
} else {
|
||||
stringResource(Res.string.this_group_and_the_d_above_it_can_spend, parentGuardianCount, delay)
|
||||
stringResource(Res.string.this_group_and_the_d_above_it_can_spend, parentGuardianCount)
|
||||
},
|
||||
isSelected = policy == SubgroupWalletPolicy.GUARDED,
|
||||
isEnabled = canGuard,
|
||||
@@ -422,6 +453,81 @@ private fun WalletPolicyChooser(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* How long a coin in the guarded subgroup's wallet waits before this group can
|
||||
* take it -- the parent's own leaf, `docs/guardian-delay.md`. Presets for what
|
||||
* people mean, and a field for the exact number of blocks, which says what it
|
||||
* works out to while it is typed.
|
||||
*/
|
||||
@OptIn(ExperimentalLayoutApi::class)
|
||||
@Composable
|
||||
private fun GuardianDelayChooser(
|
||||
input: String,
|
||||
delay: Long?,
|
||||
isCustom: Boolean,
|
||||
problem: String?,
|
||||
onPreset: (Long) -> Unit,
|
||||
onCustom: () -> Unit,
|
||||
onInput: (String) -> Unit,
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalArrangement = Arrangement.spacedBy(MaterialTheme.spacing.itemGap)
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(Res.string.how_long_before_this_group_can_spend_a_coin),
|
||||
style = MaterialTheme.typography.titleSmall
|
||||
)
|
||||
FlowRow(
|
||||
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.spacing.itemGap),
|
||||
verticalArrangement = Arrangement.spacedBy(MaterialTheme.spacing.relatedGap)
|
||||
) {
|
||||
SelectSubgroupAdminsViewModel.DELAY_PRESETS.forEach { preset ->
|
||||
FilterChip(
|
||||
selected = !isCustom && delay == preset,
|
||||
onClick = { onPreset(preset) },
|
||||
label = { Text(presetLabel(preset)) }
|
||||
)
|
||||
}
|
||||
FilterChip(
|
||||
selected = isCustom,
|
||||
onClick = onCustom,
|
||||
label = { Text(stringResource(Res.string.delay_custom)) }
|
||||
)
|
||||
}
|
||||
if (isCustom) {
|
||||
OutlinedTextField(
|
||||
value = input,
|
||||
onValueChange = onInput,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
singleLine = true,
|
||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
|
||||
label = { Text(stringResource(Res.string.delay_in_blocks)) },
|
||||
isError = problem != null,
|
||||
supportingText = { Text(problem ?: delay?.let { delayText(it) }.orEmpty()) }
|
||||
)
|
||||
} else if (delay != null && problem == null) {
|
||||
Text(text = delayText(delay), style = MaterialTheme.typography.bodyMedium)
|
||||
}
|
||||
Text(
|
||||
text = stringResource(Res.string.a_coin_the_subgroup_moves_starts_waiting_again),
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** What a preset chip calls its delay: the time it was chosen to be, not its estimate. */
|
||||
@Composable
|
||||
private fun presetLabel(blocks: Long): String = when (blocks) {
|
||||
6L -> stringResource(Res.string.delay_one_hour)
|
||||
12L -> stringResource(Res.string.delay_two_hours)
|
||||
144L -> stringResource(Res.string.delay_one_day)
|
||||
1_008L -> stringResource(Res.string.delay_one_week)
|
||||
4_320L -> stringResource(Res.string.delay_one_month)
|
||||
26_280L -> stringResource(Res.string.delay_six_months)
|
||||
else -> stringResource(Res.string.delay_longest)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun WalletPolicyRow(
|
||||
title: String,
|
||||
|
||||
+70
-1
@@ -1,5 +1,7 @@
|
||||
package com.machankura.bennu.compose.ui.view.model
|
||||
|
||||
import com.machankura.bennu.compose.text.groupedBlocks
|
||||
import com.machankura.bennu.compose.managers.GuardianDerivation
|
||||
import com.machankura.bennu.compose.ui.view.state.canGuard
|
||||
import com.machankura.bennu.compose.ui.view.state.onlyGuarded
|
||||
import com.machankura.bennu.compose.database.model.subgroupWalletPolicy
|
||||
@@ -97,6 +99,20 @@ class SelectSubgroupAdminsViewModel(
|
||||
*/
|
||||
val walletPolicy: MutableState<SubgroupWalletPolicy> = mutableStateOf(SubgroupWalletPolicy.GUARDED)
|
||||
|
||||
/**
|
||||
* How long a coin in a guarded subgroup's wallet waits before this group can
|
||||
* take it, in blocks, as typed -- `docs/guardian-delay.md`. The parent's own
|
||||
* leaf only: each ancestor above keeps the delay it chose.
|
||||
*
|
||||
* Held as the text rather than a number, and never clamped, so the field can
|
||||
* say *at most 65,535 blocks* about the number somebody actually entered.
|
||||
* [guardianDelay] reads it.
|
||||
*/
|
||||
val guardianDelayInput: MutableState<String> = mutableStateOf(GuardianDerivation.DEFAULT_DELAY.toString())
|
||||
|
||||
/** Whether the delay is being typed rather than picked from a preset. */
|
||||
val isCustomDelay: MutableState<Boolean> = mutableStateOf(false)
|
||||
|
||||
/** Whether [retrying] has been read into the form, which happens once. */
|
||||
private var prefilled = false
|
||||
|
||||
@@ -171,6 +187,10 @@ class SelectSubgroupAdminsViewModel(
|
||||
// failed ceremony can predate the parent's own certificate -- is pulled
|
||||
// back the way the threshold is pulled into its range.
|
||||
failed.subgroupWalletPolicy?.let(::setWalletPolicy)
|
||||
failed.guardianDelay?.let { delay ->
|
||||
guardianDelayInput.value = delay.toString()
|
||||
isCustomDelay.value = delay !in DELAY_PRESETS
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -236,6 +256,41 @@ class SelectSubgroupAdminsViewModel(
|
||||
walletPolicy.value = value
|
||||
}
|
||||
|
||||
/** Picks a preset delay. */
|
||||
fun setGuardianDelay(blocks: Long) {
|
||||
if (isActionPending.value) return
|
||||
|
||||
isCustomDelay.value = false
|
||||
guardianDelayInput.value = blocks.toString()
|
||||
}
|
||||
|
||||
/** Switches to typing a delay, starting from the one already chosen. */
|
||||
fun useCustomDelay() {
|
||||
if (isActionPending.value) return
|
||||
|
||||
isCustomDelay.value = true
|
||||
}
|
||||
|
||||
/** What was typed as the delay, kept as typed. */
|
||||
fun setGuardianDelayInput(value: String) {
|
||||
if (isActionPending.value) return
|
||||
|
||||
guardianDelayInput.value = value.filter { it in '0'..'9' }.take(MAX_DELAY_DIGITS)
|
||||
}
|
||||
|
||||
/** The delay typed or picked, or null while the field holds no number. */
|
||||
fun guardianDelay(): Long? = guardianDelayInput.value.toLongOrNull()
|
||||
|
||||
/** Why the delay cannot be used, or null when it can. */
|
||||
fun guardianDelayProblem(): String? {
|
||||
val delay = guardianDelay() ?: return "Give the delay in blocks."
|
||||
return when {
|
||||
delay < GuardianDerivation.MIN_DELAY -> "A delay is at least ${GuardianDerivation.MIN_DELAY} blocks."
|
||||
delay > GuardianDerivation.MAX_DELAY -> "A delay is at most ${GuardianDerivation.MAX_DELAY.groupedBlocks()} blocks."
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
/** The subgroup's admins: everyone ticked, plus the coordinator. */
|
||||
fun adminCount(): Int = selectedPublicKeys.size + 1
|
||||
|
||||
@@ -269,6 +324,7 @@ class SelectSubgroupAdminsViewModel(
|
||||
if (walletPolicy.value == SubgroupWalletPolicy.GUARDED && !loaded.canGuard) {
|
||||
return "This group's own guardian keys can't be read, so it can't guard a subgroup."
|
||||
}
|
||||
if (walletPolicy.value == SubgroupWalletPolicy.GUARDED) guardianDelayProblem()?.let { return it }
|
||||
|
||||
|
||||
if (loaded.isResolvingKeyPackages) return "Checking who can be added…"
|
||||
@@ -347,7 +403,10 @@ class SelectSubgroupAdminsViewModel(
|
||||
// Carried on the proposal so every admin is told at the join gate,
|
||||
// and on the session so whoever proposes the certificate proposes
|
||||
// it under the same one.
|
||||
walletPolicy = walletPolicy.value
|
||||
walletPolicy = walletPolicy.value,
|
||||
// The parent's own leaf, and only for a guarded subgroup.
|
||||
// docs/guardian-delay.md.
|
||||
guardianDelay = guardianDelay().takeIf { walletPolicy.value == SubgroupWalletPolicy.GUARDED }
|
||||
)
|
||||
|
||||
isActionPending.value = false
|
||||
@@ -379,6 +438,16 @@ class SelectSubgroupAdminsViewModel(
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* The delays the picker offers, in blocks -- `docs/guardian-delay.md`, D4:
|
||||
* an hour, two (the default), a day, a week, a month, six months, and the
|
||||
* longest a leaf can carry.
|
||||
*/
|
||||
val DELAY_PRESETS: List<Long> = listOf(6L, 12L, 144L, 1_008L, 4_320L, 26_280L, GuardianDerivation.MAX_DELAY)
|
||||
|
||||
/** Enough digits for anything past the ceiling, so the field can say so. */
|
||||
private const val MAX_DELAY_DIGITS = 7
|
||||
|
||||
private const val TAG = "SelectSubgroupAdminsViewModel"
|
||||
|
||||
fun factory(
|
||||
|
||||
+72
@@ -1,5 +1,7 @@
|
||||
package com.machankura.bennu.compose.ui.view.model
|
||||
|
||||
import kotlin.test.assertTrue
|
||||
import kotlin.test.assertFalse
|
||||
import kotlin.test.assertNull
|
||||
import com.machankura.bennu.compose.managers.GuardianDerivation
|
||||
import com.machankura.bennu.compose.nostr.subgroup.WalletPolicyReading
|
||||
@@ -81,6 +83,7 @@ class SelectSubgroupAdminsViewModelJvmTest {
|
||||
private fun failed(
|
||||
parentChatRoomId: String? = this.parentChatRoomId,
|
||||
walletPolicy: SubgroupWalletPolicy? = null,
|
||||
guardianDelay: Long? = null,
|
||||
) = DkgSession(
|
||||
id = failedId,
|
||||
chatRoomId = this.parentChatRoomId,
|
||||
@@ -96,6 +99,7 @@ class SelectSubgroupAdminsViewModelJvmTest {
|
||||
round2AuxRandom = "bb".repeat(32),
|
||||
parentChatRoomId = parentChatRoomId,
|
||||
walletPolicy = walletPolicy?.tagValue,
|
||||
guardianDelay = guardianDelay,
|
||||
)
|
||||
|
||||
private fun chatRepository(
|
||||
@@ -270,4 +274,72 @@ class SelectSubgroupAdminsViewModelJvmTest {
|
||||
"refused here, not after a ceremony",
|
||||
)
|
||||
}
|
||||
|
||||
// ---- the guardian delay: docs/guardian-delay.md, Phase 5 ---------------
|
||||
|
||||
private suspend fun loadedWithName(session: DkgSession? = null) = viewModel(session).apply {
|
||||
initiate()
|
||||
awaitLoaded()
|
||||
setName("Tapscript")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `a guarded subgroup's delay starts at the default`(): Unit = runBlocking {
|
||||
val viewModel = loadedWithName()
|
||||
|
||||
assertEquals(12L, viewModel.guardianDelay())
|
||||
assertFalse(viewModel.isCustomDelay.value)
|
||||
assertNull(viewModel.guardianDelayProblem())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `a preset and a typed delay are what refusal judges`(): Unit = runBlocking {
|
||||
val viewModel = loadedWithName()
|
||||
|
||||
viewModel.setGuardianDelay(4_320)
|
||||
assertEquals(4_320L, viewModel.guardianDelay())
|
||||
assertNull(viewModel.refusal()?.takeIf { "delay" in it })
|
||||
|
||||
viewModel.useCustomDelay()
|
||||
viewModel.setGuardianDelayInput("2,016")
|
||||
assertEquals(2_016L, viewModel.guardianDelay(), "grouping is dropped as it is typed")
|
||||
assertTrue(viewModel.isCustomDelay.value)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `a delay below six or above 65535 is refused with its reason`(): Unit = runBlocking {
|
||||
val viewModel = loadedWithName()
|
||||
viewModel.useCustomDelay()
|
||||
|
||||
viewModel.setGuardianDelayInput("5")
|
||||
assertEquals("A delay is at least 6 blocks.", viewModel.refusal())
|
||||
|
||||
viewModel.setGuardianDelayInput("65536")
|
||||
assertEquals(65_536L, viewModel.guardianDelay(), "kept as typed, so the field can say what is wrong with it")
|
||||
assertEquals("A delay is at most 65,535 blocks.", viewModel.refusal())
|
||||
|
||||
viewModel.setGuardianDelayInput("")
|
||||
assertEquals("Give the delay in blocks.", viewModel.refusal())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `an unguarded subgroup is not held to a delay`(): Unit = runBlocking {
|
||||
val viewModel = loadedWithName()
|
||||
viewModel.useCustomDelay()
|
||||
viewModel.setGuardianDelayInput("5")
|
||||
viewModel.setWalletPolicy(SubgroupWalletPolicy.UNGUARDED)
|
||||
|
||||
assertNull(viewModel.refusal()?.takeIf { "delay" in it })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `a retry starts from the failed ceremony's delay`(): Unit = runBlocking {
|
||||
val preset = loadedWithName(failed(walletPolicy = SubgroupWalletPolicy.GUARDED, guardianDelay = 1_008))
|
||||
assertEquals(1_008L, preset.guardianDelay())
|
||||
assertFalse(preset.isCustomDelay.value, "a preset comes back as the preset")
|
||||
|
||||
val typed = loadedWithName(failed(walletPolicy = SubgroupWalletPolicy.GUARDED, guardianDelay = 2_016))
|
||||
assertEquals(2_016L, typed.guardianDelay())
|
||||
assertTrue(typed.isCustomDelay.value, "anything else comes back in the field")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user