@@ -47,6 +47,8 @@ import javax.inject.Named
4747import javax.inject.Singleton
4848import kotlin.math.ceil
4949import 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
0 commit comments