Fix Kotlin extensions throws
@@ -34,14 +34,6 @@ suspend fun WalletManager.createSweeper(wallet: Wallet, key: Key): WalletSweeper
}
}
-/** See [WalletManager.createWalletConnector]. */
-@throws(WalletConnectorError::class)
-suspend fun WalletManager.createWalletConnector(): WalletConnector {
- return suspendForCompletion<WalletConnector, WalletConnectorError> {
- createWalletConnector(it)
- }
-}
-
/** See [WalletSweeper.estimate]. */
@Throws(FeeEstimationError::class)
suspend fun WalletSweeper.estimate(networkFee: NetworkFee): TransferFeeBasis {
@@ -82,6 +74,14 @@ suspend fun PaymentProtocolRequest.estimate(fee: NetworkFee): TransferFeeBasis {
}
}
+/** See [WalletManager.createWalletConnector]. */
+@Throws(WalletConnectorError::class)
+suspend fun WalletManager.createWalletConnector(): WalletConnector {
+ return suspendForCompletion<WalletConnector, WalletConnectorError> {
+ createWalletConnector(it)
+ }
+}
+
private suspend fun <R, E : Exception> suspendForCompletion(
block: (CompletionHandler<R, E>) -> kotlin.Unit
): R = suspendCancellableCoroutine { continuation ->
