Skip to content

Commit c2dd3db

Browse files
committed
fix: namespace imports
1 parent cdd7681 commit c2dd3db

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/src/main/java/to/bitkit/repositories/BlocktankRepo.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ import javax.inject.Named
4747
import javax.inject.Singleton
4848
import kotlin.math.ceil
4949
import kotlin.math.min
50+
import kotlin.time.Duration
51+
import kotlin.time.Duration.Companion.seconds
5052

5153
@Singleton
5254
@Suppress("LongParameterList")
@@ -408,7 +410,7 @@ class BlocktankRepo @Inject constructor(
408410
suspend fun claimGiftCode(
409411
code: String,
410412
amount: ULong,
411-
waitTimeout: kotlin.time.Duration = kotlin.time.Duration.parse("30s"),
413+
waitTimeout: Duration = TIMEOUT_GIFT_CODE,
412414
): Result<GiftClaimResult> = withContext(bgDispatcher) {
413415
runCatching {
414416
require(code.isNotBlank()) { "Gift code cannot be blank" }
@@ -457,7 +459,7 @@ class BlocktankRepo @Inject constructor(
457459
giftOrder(clientNodeId = nodeId, code = "blocktank-gift-code:$code")
458460
}
459461

460-
val orderId = checkNotNull(order.orderId) { "Order ID is nil" }
462+
val orderId = checkNotNull(order.orderId) { "Order ID is null" }
461463

462464
val openedOrder = openChannel(orderId).getOrThrow()
463465

@@ -474,6 +476,7 @@ class BlocktankRepo @Inject constructor(
474476
private const val DEFAULT_CHANNEL_EXPIRY_WEEKS = 6u
475477
private const val DEFAULT_SOURCE = "bitkit-android"
476478
private const val PEER_CONNECTION_DELAY_MS = 2_000L
479+
private val TIMEOUT_GIFT_CODE = 30.seconds
477480
}
478481
}
479482

app/src/main/java/to/bitkit/ui/sheets/GiftViewModel.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package to.bitkit.ui.sheets
33
import androidx.lifecycle.ViewModel
44
import androidx.lifecycle.viewModelScope
55
import com.synonym.bitkitcore.Activity
6+
import com.synonym.bitkitcore.LightningActivity
67
import com.synonym.bitkitcore.PaymentState
78
import com.synonym.bitkitcore.PaymentType
89
import dagger.hilt.android.lifecycle.HiltViewModel
@@ -97,7 +98,7 @@ class GiftViewModel @Inject constructor(
9798
private suspend fun insertGiftActivity(result: GiftClaimResult.SuccessWithoutLiquidity) {
9899
val nowTimestamp = nowTimestamp().epochSecond.toULong()
99100

100-
val lightningActivity = com.synonym.bitkitcore.LightningActivity(
101+
val lightningActivity = LightningActivity(
101102
id = result.paymentHashOrTxId,
102103
txType = PaymentType.RECEIVED,
103104
status = PaymentState.SUCCEEDED,

0 commit comments

Comments
 (0)