clightning4j / JRPClightning

:zap: Java framework for C-Lightning to work with the RPC interface, and also the library simplifies the work to develop custom plugins with Java, Kotlin, and all the languages that supports the Java dependencies :zap:
https://clightning4j.github.io/JRPClightning/
GNU General Public License v2.0
16 stars 9 forks source link

feat: support multiple classes with annotations #85

Closed theborakompanioni closed 1 year ago

theborakompanioni commented 1 year ago

Resolves #83.

Before this commit, the lib scanned all classes and registered any annotated method (RPCMethod, Subscription, Hook, etc.) found. This would lead to errors when multiple classes are on the classpath containing the annotations and were invoked on them. When this commit is applied, the lib will only register methods with annotations that are contained in the class on which start has been invoked.

This should not be a breaking change as the library only supports one instance of a Plugin class at a time, but makes in possible to "at least" contain multiple classes and only creating an instance of one of them.

vincenzopalazzo commented 1 year ago

Ok this is the failure I will open an issue, will be good to disable it or do other stuff because the test looks flaky

jrcplightning_1  |   Test testCommandConnectAndCloseOne FAILED
jrcplightning_1  | 
jrcplightning_1  |   junit.framework.AssertionFailedError: Error when running the command FUNDCHANNEL.
jrcplightning_1  |   Error inside command with error code: 304
jrcplightning_1  |    Message: Still syncing with bitcoin network 
jrcplightning_1  |    listfunds -> {"outputs":