UnstoppableSwap / core

Bitcoin–Monero Cross-chain Atomic Swap (+ GUI)
GNU General Public License v3.0
20 stars 6 forks source link

Complete event system #104

Closed binarybaron closed 1 month ago

binarybaron commented 1 month ago

This issue is for tracking all features related to sending all required events from host to guest.

Einliterflasche commented 1 month ago

On the host side we hard code the event names (e.g. const TIMELOCK_CHANGE_EVENT_NAME: &str = "timelock-change;") which we then manually use on the guest side (listen<...>("timelock-change")). ideally we could also #[typeshare] these constants

binarybaron commented 1 month ago

We can put all our events into one big enum and send that over the event system over one event channel/name. This'll give us some type safety (won't have to cast received objects via listen<TYPE>) and will result in less event names having to be hardcoded on both host and guest side.