-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format test_breez_sdk.kts using ktlint
- Loading branch information
1 parent
c88d257
commit 7d3a462
Showing
1 changed file
with
17 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | ||
} | ||
} |