-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ef0c5f
commit bbcfd2f
Showing
13 changed files
with
61 additions
and
62 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
apple/Sources/Sargon/Extensions/Methods/Profile/MFA/TimePeriodUnit+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension TimePeriodUnit { | ||
public var values: [Int] { | ||
Array(1 ... Int(constantMaxRecoveryConfirmationFallbackPeriodUnits())) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
apple/Tests/TestCases/Profile/MFA/TimePeriodUnitTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import CustomDump | ||
import Foundation | ||
import Sargon | ||
import SargonUniFFI | ||
import XCTest | ||
|
||
final class TimePeriodUnitTests: TestCase { | ||
func test() { | ||
let sut = TimePeriodUnit.days | ||
XCTAssertEqual(sut.values, Array(1 ... 9999)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
#[uniffi::export] | ||
pub fn constant_entity_name_max_length() -> u64 { | ||
pub fn constant_display_name_max_length() -> u64 { | ||
sargon::DisplayName::MAX_LEN as u64 | ||
} | ||
|
||
#[uniffi::export] | ||
pub fn constant_entity_name_max_length() -> u64 { | ||
constant_display_name_max_length() | ||
} | ||
|
||
#[uniffi::export] | ||
pub fn constant_min_required_xrd_for_account_deletion() -> f64 { | ||
sargon::MIN_REQUIRED_XRD_FOR_ACCOUNT_DELETION | ||
} | ||
|
||
#[uniffi::export] | ||
pub fn constant_max_recovery_confirmation_fallback_period_units() -> u16 { | ||
sargon::SecurityShieldBuilder::MAX_RECOVERY_CONFIRMATION_FALLBACK_PERIOD_UNITS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/SharedConstants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
package com.radixdlt.sargon.extensions | ||
|
||
import com.radixdlt.sargon.Account | ||
import com.radixdlt.sargon.DisplayName | ||
import com.radixdlt.sargon.Persona | ||
import com.radixdlt.sargon.annotation.KoverIgnore | ||
import com.radixdlt.sargon.constantDisplayNameMaxLength | ||
import com.radixdlt.sargon.constantEntityNameMaxLength | ||
import com.radixdlt.sargon.constantMinRequiredXrdForAccountDeletion | ||
import com.radixdlt.sargon.extensions.SharedConstants.displayNameMaxLength | ||
import com.radixdlt.sargon.extensions.SharedConstants.entityNameMaxLength | ||
|
||
@KoverIgnore | ||
object SharedConstants { | ||
val minRequiredXrdForAccountDeletion = constantMinRequiredXrdForAccountDeletion() | ||
val entityNameMaxLength = constantEntityNameMaxLength().toLong() | ||
val displayNameMaxLength = constantDisplayNameMaxLength().toLong() | ||
} | ||
|
||
@KoverIgnore | ||
val Account.Companion.nameMaxLength: Long | ||
get() = constantEntityNameMaxLength().toLong() | ||
get() = entityNameMaxLength | ||
|
||
@KoverIgnore | ||
val Persona.Companion.nameMaxLength: Long | ||
get() = constantEntityNameMaxLength().toLong() | ||
get() = entityNameMaxLength | ||
|
||
val DisplayName.Companion.maxLength: Long | ||
get() = displayNameMaxLength | ||
5 changes: 2 additions & 3 deletions
5
jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/TimePeriodUnit.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
package com.radixdlt.sargon.extensions | ||
|
||
import com.radixdlt.sargon.TimePeriodUnit | ||
import com.radixdlt.sargon.timePeriodUnitValues | ||
import com.radixdlt.sargon.constantMaxRecoveryConfirmationFallbackPeriodUnits | ||
|
||
val TimePeriodUnit.values | ||
get() = timePeriodUnitValues(this).toList() | ||
.map { it.toInt() } | ||
get() = (1..constantMaxRecoveryConfirmationFallbackPeriodUnits().toInt()).toList() |