Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implemented and tested the RawBooks for the websocket stream #2

Merged
merged 1 commit into from
Aug 31, 2018

Conversation

JoshuaBatty
Copy link
Contributor

Hey @wisespace-io thanks for your suggestions. Everything is working perfectly! Cheers.

@JoshuaBatty
Copy link
Contributor Author

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.

@wisespace-io
Copy link
Owner

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.

@wisespace-io wisespace-io merged commit 6735d22 into wisespace-io:master Aug 31, 2018
@wisespace-io
Copy link
Owner

@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

@JoshuaBatty
Copy link
Contributor Author

Great thanks @wisespace-io !! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants