Closed JoshuaBatty closed 6 years ago
Actually, i'm finding some weird behaviour. It seems to only work every now and then.
i'd say 50% of the time it works as expected and I can receive the raw_book stream, the other 50% of the time im getting the following error
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: Error(Json(Error("data did not match any variant of untagged enum NotificationEvent", line: 0, column: 0)), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })', libcore/result.rs:945:5
Strange that it seems to happen randomly.... Not sure why this is.
Okay, according to the error message, it is missing to handle a NotificationEvent: "data did not match any variant of untagged enum NotificationEvent"
I noticed that we are not handling the subscription confirmation for Raw Books. See: https://github.com/wisespace-io/bitfinex-rs/blob/master/src/events.rs#L9
I will merge your Pull Request and add it in another commit as we also need to update the chanId to u32 in all NotificatioEvents, plus fix a typo.
@JoshuaBatty I implemented a fix and it should be fine now. I changed NotificationEvent, so check the example to update your code accordingly
https://github.com/wisespace-io/bitfinex-rs/blob/master/examples/src/public_channels.rs#L15
Thank you for the contribution
Great thanks @wisespace-io !! :)
Hey @wisespace-io thanks for your suggestions. Everything is working perfectly! Cheers.