Skip to content

Commit

Permalink
Rust cln-rpc crate: Fix call_enum and call
Browse files Browse the repository at this point in the history
I've broken the error-handling for `call` in a previous commit.
The key problem is that it failed to parse Json-RPC error's
that were returned by the server. It always returned a parse-
error instead.

To fix it I've adapted `call_raw_request`.
In the previous implementation local errors (e.g: Failing to find the
socket-file) where returned in a Result::Err. However, when the
rpc-server returned an error the data was encoded in the Result::Ok.

In this commit every error is returned as a `Result::Err` and
various methods and other calls have been edited to match this behavior.

I've also added additonal testing
  • Loading branch information
ErikDeSmedt authored and cdecker committed Jan 9, 2024
1 parent dba977d commit 000fceb
Showing 1 changed file with 243 additions and 122 deletions.
Loading

0 comments on commit 000fceb

Please sign in to comment.