Skip to content

Commit

Permalink
f Fix Kotlin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Feb 2, 2024
1 parent 5a5d403 commit 33170d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
@RunWith(AndroidJUnit4::class)
class AndroidLibTest {
@Test fun node_start_stop() {
val mnemonic1 = generateEntropyMnemonic()
val mnemonic2 = generateEntropyMnemonic()

val tmpDir1 = createTempDirectory("ldk_node").toString()
println("Random dir 1: $tmpDir1")
val tmpDir2 = createTempDirectory("ldk_node").toString()
Expand All @@ -36,8 +39,8 @@ class AndroidLibTest {
config2.network = Network.REGTEST
config2.logLevel = LogLevel.TRACE

val builder1 = Builder.fromConfig(config1)
val builder2 = Builder.fromConfig(config2)
val builder1 = Builder.fromEntropyBip39Mnemonic(mnemonic1, null, config1)
val builder2 = Builder.fromEntropyBip39Mnemonic(mnemonic2, null, config2)

val node1 = builder1.build()
val node2 = builder2.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ class LibraryTest {
}

@Test fun fullCycle() {
val mnemonic1 = generateEntropyMnemonic()
val mnemonic2 = generateEntropyMnemonic()

val tmpDir1 = createTempDirectory("ldk_node").toString()
println("Random dir 1: $tmpDir1")
val tmpDir2 = createTempDirectory("ldk_node").toString()
Expand All @@ -129,9 +132,10 @@ class LibraryTest {
config2.logLevel = LogLevel.TRACE
println("Config 2: $config2")

val builder1 = Builder.fromConfig(config1)
val builder1 = Builder.fromEntropyBip39Mnemonic(mnemonic1, null, config1)
val builder2 = Builder.fromEntropyBip39Mnemonic(mnemonic2, null, config2)

builder1.setEsploraServer(esploraEndpoint)
val builder2 = Builder.fromConfig(config2)
builder2.setEsploraServer(esploraEndpoint)

val node1 = builder1.build()
Expand Down

0 comments on commit 33170d6

Please sign in to comment.