Skip to content

Commit

Permalink
Format test_breez_sdk.kts using ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
erdemyerebasmaz committed Nov 6, 2024
1 parent c88d257 commit 7d3a462
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions libs/sdk-bindings/tests/bindings/test_breez_sdk.kts
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@

import breez_sdk.BreezEvent

class SDKListener: breez_sdk.EventListener {
class SDKListener : breez_sdk.EventListener {
override fun onEvent(e: BreezEvent) {
println(e.toString());
println(e.toString())
}
}

class LogStreamListener: breez_sdk.LogStream {
class LogStreamListener : breez_sdk.LogStream {
override fun log(l: breez_sdk.LogEntry) {
if (l.level != "TRACE") {
println(l.line);
println(l.line)
}
}
}

try {
breez_sdk.setLogStream(LogStreamListener(), breez_sdk.LevelFilter.TRACE);
var seed = breez_sdk.mnemonicToSeed("repeat hawk combine screen network rhythm ritual social neither casual volcano powder");
var config = breez_sdk.defaultConfig(breez_sdk.EnvironmentType.PRODUCTION, "code", breez_sdk.NodeConfig.Greenlight(breez_sdk.GreenlightNodeConfig(null, null)))
breez_sdk.setLogStream(LogStreamListener(), breez_sdk.LevelFilter.TRACE)
var seed = breez_sdk.mnemonicToSeed("repeat hawk combine screen network rhythm ritual social neither casual volcano powder")
var config =
breez_sdk.defaultConfig(
breez_sdk.EnvironmentType.PRODUCTION,
"code",
breez_sdk.NodeConfig.Greenlight(breez_sdk.GreenlightNodeConfig(null, null)),
)
var connectRequest = breez_sdk.ConnectRequest(config, seed)
var sdkServices = breez_sdk.connect(connectRequest, SDKListener());
var nodeInfo = sdkServices.nodeInfo();
assert(nodeInfo.id.equals("027e2b899f9f75b92a1ad210da21d74e7314e3499375213a71c6bf3e1b4b4394a1"));
}catch (ex: Exception) {
var sdkServices = breez_sdk.connect(connectRequest, SDKListener())
var nodeInfo = sdkServices.nodeInfo()
assert(nodeInfo.id.equals("027e2b899f9f75b92a1ad210da21d74e7314e3499375213a71c6bf3e1b4b4394a1"))
} catch (ex: Exception) {
throw RuntimeException(ex.toString())
}
}

0 comments on commit 7d3a462

Please sign in to comment.