Skip to content

Commit be4b895

Browse files
committed
refactor: Use UInt in regtestMine
1 parent d71fea0 commit be4b895

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/src/main/java/to/bitkit/ui/settings/BlocktankRegtestScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fun BlocktankRegtestScreen(
155155
isMining = true
156156
try {
157157
val count =
158-
mineBlockCount.toIntOrNull() ?: error("Invalid block count: $mineBlockCount")
158+
mineBlockCount.toUIntOrNull() ?: error("Invalid block count: $mineBlockCount")
159159
viewModel.regtestMine(count)
160160
Logger.debug("Successfully mined $count blocks")
161161
app.toast(

app/src/main/java/to/bitkit/ui/settings/BlocktankRegtestViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class BlocktankRegtestViewModel @Inject constructor(
1212
* Mines a number of blocks on the regtest network.
1313
* @param count Number of blocks to mine. Default is 1.
1414
*/
15-
suspend fun regtestMine(count: Int = 1) {
16-
uniffi.bitkitcore.regtestMine(count = count.toUInt())
15+
suspend fun regtestMine(count: UInt = 1u) {
16+
uniffi.bitkitcore.regtestMine(count = count)
1717
}
1818

1919
/**

0 commit comments

Comments
 (0)