Skip to content

Commit 476446f

Browse files
lint format kotlin
1 parent 361b610 commit 476446f

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

bindings/kotlin/ldk-node-android/lib/build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.*
2-
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
3-
41
// library version is defined in gradle.properties
52
val libraryVersion: String by project
63

bindings/kotlin/ldk-node-jvm/lib/build.gradle.kts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.*
2-
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
1+
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
2+
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
3+
import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
4+
import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
5+
import org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_ERROR
6+
import org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_OUT
37

48
// library version is defined in gradle.properties
59
val libraryVersion: String by project
@@ -32,12 +36,12 @@ dependencies {
3236
// Use the JUnit 5 integration.
3337
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.1")
3438

35-
//// This dependency is exported to consumers, that is to say found on their compile classpath.
36-
//api("org.apache.commons:commons-math3:3.6.1")
39+
// // This dependency is exported to consumers, that is to say found on their compile classpath.
40+
// api("org.apache.commons:commons-math3:3.6.1")
3741

38-
//// This dependency is used internally, and not exposed to consumers on their own compile classpath.
39-
//implementation("com.google.guava:guava:31.1-jre")
40-
// Align versions of all Kotlin components
42+
// // This dependency is used internally, and not exposed to consumers on their own compile classpath.
43+
// implementation("com.google.guava:guava:31.1-jre")
44+
// Align versions of all Kotlin components
4145
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
4246

4347
// Use the Kotlin JDK 8 standard library.
@@ -50,13 +54,13 @@ tasks.named<Test>("test") {
5054
// Use JUnit Platform for unit tests.
5155
useJUnitPlatform()
5256

53-
testLogging {
57+
testLogging {
5458
events(PASSED, SKIPPED, FAILED, STANDARD_OUT, STANDARD_ERROR)
5559
exceptionFormat = FULL
5660
showExceptions = true
5761
showCauses = true
5862
showStackTraces = true
59-
showStandardStreams = true
63+
showStandardStreams = true
6064
}
6165
}
6266

@@ -89,8 +93,8 @@ afterEvaluate {
8993
developers {
9094
developer {
9195
id.set("tnull")
92-
name.set("Elias Rohrer")
93-
email.set("dev@tnull.de")
96+
name.set("Elias Rohrer")
97+
email.set("dev@tnull.de")
9498
}
9599
}
96100
}

bindings/kotlin/ldk-node-jvm/lib/src/test/kotlin/org/lightningdevkit/ldknode/LibraryTest.kt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/*
2-
* This Kotlin source file was generated by the Gradle 'init' task.
3-
*/
41
package org.lightningdevkit.ldknode
52

63
import kotlin.UInt
@@ -11,6 +8,8 @@ import java.net.URI
118
import java.net.http.HttpClient
129
import java.net.http.HttpRequest
1310
import java.net.http.HttpResponse
11+
import kotlin.io.path.createTempDirectory
12+
import kotlin.test.assertEquals
1413

1514
fun runCommandAndWait(vararg cmd: String): String {
1615
println("Running command \"${cmd.joinToString(" ")}\"")
@@ -29,7 +28,7 @@ fun mine(blocks: UInt): String {
2928
val output = runCommandAndWait("bitcoin-cli", "-regtest", "generatetoaddress", blocks.toString(), address)
3029
println("Mining output: $output")
3130
val re = Regex("\n.+\n\\]$")
32-
val lastBlock = re.find(output)!!.value.replace("]","").replace("\"", "").replace("\n","").trim()
31+
val lastBlock = re.find(output)!!.value.replace("]", "").replace("\"", "").replace("\n", "").trim()
3332
println("Last block: $lastBlock")
3433
return lastBlock
3534
}
@@ -54,32 +53,32 @@ fun setup() {
5453

5554
fun waitForTx(esploraEndpoint: String, txid: String) {
5655
var esploraPickedUpTx = false
57-
val re = Regex("\"txid\":\"$txid\"");
56+
val re = Regex("\"txid\":\"$txid\"")
5857
while (!esploraPickedUpTx) {
5958
val client = HttpClient.newBuilder().build()
6059
val request = HttpRequest.newBuilder()
6160
.uri(URI.create(esploraEndpoint + "/tx/" + txid))
62-
.build();
61+
.build()
6362

64-
val response = client.send(request, HttpResponse.BodyHandlers.ofString());
63+
val response = client.send(request, HttpResponse.BodyHandlers.ofString())
6564

66-
esploraPickedUpTx = re.containsMatchIn(response.body());
65+
esploraPickedUpTx = re.containsMatchIn(response.body())
6766
Thread.sleep(500)
6867
}
6968
}
7069

7170
fun waitForBlock(esploraEndpoint: String, blockHash: String) {
7271
var esploraPickedUpBlock = false
73-
val re = Regex("\"in_best_chain\":true");
72+
val re = Regex("\"in_best_chain\":true")
7473
while (!esploraPickedUpBlock) {
7574
val client = HttpClient.newBuilder().build()
7675
val request = HttpRequest.newBuilder()
7776
.uri(URI.create(esploraEndpoint + "/block/" + blockHash + "/status"))
78-
.build();
77+
.build()
7978

80-
val response = client.send(request, HttpResponse.BodyHandlers.ofString());
79+
val response = client.send(request, HttpResponse.BodyHandlers.ofString())
8180

82-
esploraPickedUpBlock = re.containsMatchIn(response.body());
81+
esploraPickedUpBlock = re.containsMatchIn(response.body())
8382
Thread.sleep(500)
8483
}
8584
}
@@ -172,7 +171,7 @@ class LibraryTest {
172171

173172
val fundingTxid = when (channelPendingEvent1) {
174173
is Event.ChannelPending -> channelPendingEvent1.fundingTxo.txid
175-
else -> return
174+
else -> return
176175
}
177176

178177
waitForTx(esploraEndpoint, fundingTxid)
@@ -202,7 +201,7 @@ class LibraryTest {
202201

203202
val channelId = when (channelReadyEvent2) {
204203
is Event.ChannelReady -> channelReadyEvent2.channelId
205-
else -> return
204+
else -> return
206205
}
207206

208207
val invoice = node2.receivePayment(2500000u, "asdf", 9217u)

0 commit comments

Comments
 (0)