Skip to content

Commit e07f31d

Browse files
committed
refactor: Use defaultCreateOrderOptions fn in fee estimate
1 parent ebff98e commit e07f31d

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

app/src/main/java/to/bitkit/viewmodels/BlocktankViewModel.kt

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,7 @@ class BlocktankViewModel @Inject constructor(
138138
receivingBalanceSats: ULong,
139139
channelExpiryWeeks: UInt = 6u,
140140
): IBtEstimateFeeResponse2 {
141-
val nodeId = lightningService.nodeId ?: throw ServiceError.NodeNotStarted
142-
143-
// TODO use defaultCreateOrderOptions() ?!
144-
val options = defaultCreateOrderOptions.copy(
145-
clientBalanceSat = spendingBalanceSats,
146-
clientNodeId = nodeId,
147-
)
141+
val options = defaultCreateOrderOptions(clientBalanceSat = spendingBalanceSats)
148142

149143
return coreService.blocktank.estimateFee(
150144
lspBalanceSat = receivingBalanceSats,
@@ -186,19 +180,3 @@ class BlocktankViewModel @Inject constructor(
186180
)
187181
}
188182
}
189-
190-
private val defaultCreateOrderOptions = CreateOrderOptions(
191-
clientBalanceSat = 0uL,
192-
lspNodeId = null,
193-
couponCode = "",
194-
source = "bitkit-android",
195-
discountCode = null,
196-
zeroConf = true,
197-
zeroConfPayment = false,
198-
zeroReserve = true,
199-
clientNodeId = null,
200-
signature = null,
201-
timestamp = null,
202-
refundOnchainAddress = null,
203-
announceChannel = false,
204-
)

0 commit comments

Comments
 (0)