talaia-labs / rust-teos

The Eye of Satoshi - Lightning Watchtower
https://talaia-labs.github.io/talaia.watch/
MIT License
135 stars 63 forks source link

Simplify apis #9

Closed sr-gi closed 2 years ago

sr-gi commented 2 years ago

Makes proto messages derive serde so they can be reused as requests / responses for the API. WIth that, all custom messages created for api::http are not needed anymore and can be therefore removed.

Reworks ApiError and make rejection functions actually return a rejection (and therefor Err). Also revamps api::htto::handle_rejection so uncatch rejections can be passed through (which was the original intention, I just couldn't figure out how to do so).

Finally, adds serialization functions for the things need custom serde, like vector of locators (Vec<Vec> -> Vec) and appointment status. The later is due to how tonic deals with enums internally.