Skip to content

Commit 76cda5e

Browse files
committed
fix: add WithForeign attribute to LogWriter interface
With this attribute, the LogWriter trait can be implemented on the foreign side, e.g. in Kotlin, the CustomLogWriter can implement LogWriter directly.
1 parent a61455a commit 76cda5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ fun waitForBlock(esploraEndpoint: String, blockHash: String) {
9393
}
9494
}
9595

96-
class CustomLogWriter(private var currentLogLevel: LogLevel = LogLevel.INFO, noPointer: NoPointer = NoPointer) :
97-
LogWriter(noPointer) {
96+
class CustomLogWriter(private var currentLogLevel: LogLevel = LogLevel.INFO) :
97+
LogWriter {
9898
enum class LogLevel {
9999
ERROR, WARN, INFO, DEBUG, TRACE, GOSSIP
100100
}

bindings/ldk_node.udl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dictionary LogRecord {
4141
u32 line;
4242
};
4343

44-
[Trait]
44+
[Trait, WithForeign]
4545
interface LogWriter {
4646
void log(LogRecord record);
4747
};

0 commit comments

Comments
 (0)