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

Adds Trades Stream #29

Merged
merged 6 commits into from
Jan 9, 2022
Merged

Adds Trades Stream #29

merged 6 commits into from
Jan 9, 2022

Conversation

wilkosz
Copy link
Contributor

@wilkosz wilkosz commented Jan 9, 2022

Background

Adds trade stream based on Binance documentation https://binance-docs.github.io/apidocs/spot/en/#trade-streams

Todo

  • Allow trades streams within websocket lib
  • Add spec test
  • Test
  • Increment Version -> 1.2.10

@wilkosz wilkosz changed the title Trade stream Adds Trade Stream Jan 9, 2022
@wilkosz wilkosz changed the title Adds Trade Stream Adds Trades Stream Jan 9, 2022
@wilkosz
Copy link
Contributor Author

wilkosz commented Jan 9, 2022

@Jakenberg Did you ever get uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState while running RSpec? I don't know if it is an Apple Silicon chip issue or something else, digging into it now.

@wilkosz
Copy link
Contributor Author

wilkosz commented Jan 9, 2022

@Jakenberg Looks like its Rails 7.0.1 bug

joshuawilkosz@joshua binance-ruby % bundle exec rspec spec/binance/websocket_spec.rb

An error occurred while loading ./spec/binance/websocket_spec.rb.
Failure/Error: require "active_support/core_ext/string"

NameError:
  uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/xml_mini.rb:184:in `current_thread_backend'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/xml_mini.rb:103:in `backend='
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/xml_mini.rb:201:in `<module:ActiveSupport>'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/xml_mini.rb:11:in `<top (required)>'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/core_ext/array/conversions.rb:3:in `require'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/core_ext/array/conversions.rb:3:in `<top (required)>'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/duration.rb:3:in `require'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/duration.rb:3:in `<top (required)>'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/core_ext/time/calculations.rb:3:in `require'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/core_ext/time/calculations.rb:3:in `<top (required)>'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/core_ext/string/conversions.rb:4:in `require'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/core_ext/string/conversions.rb:4:in `<top (required)>'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/core_ext/string.rb:3:in `require'
# /Users/joshuawilkosz/.rvm/gems/ruby-2.7.5/gems/activesupport-7.0.1/lib/active_support/core_ext/string.rb:3:in `<top (required)>'
# ./lib/binance-ruby.rb:1:in `require'
# ./lib/binance-ruby.rb:1:in `<top (required)>'
# ./spec/spec_helper.rb:19:in `require'
# ./spec/spec_helper.rb:19:in `<top (required)>'
# ./spec/binance/websocket_spec.rb:1:in `require'
# ./spec/binance/websocket_spec.rb:1:in `<top (required)>'
No examples found.

Finished in 0.00002 seconds (files took 0.17595 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

Rails 6.x.x works as expected

@wilkosz wilkosz marked this pull request as ready for review January 9, 2022 01:31
@0xjmp 0xjmp merged commit 21b672a into 0xjmp:master Jan 9, 2022
@0xjmp
Copy link
Owner

0xjmp commented Jan 9, 2022

I accidentally merged this so put up another PR when you have the rails 7 fix and I'll review. Haven't pushed to rubygems yet.

@0xjmp
Copy link
Owner

0xjmp commented Jan 9, 2022

This error occurs in rails 7 only when active_support/isolated_execution_state isn't required. You should do this in your application so that binance-ruby gem can continue to work on older versions of rails.

Context: rails/rails#43851 (comment)

@wilkosz
Copy link
Contributor Author

wilkosz commented Jan 9, 2022

@Jakenberg Handling here #30 (comment)

@wilkosz wilkosz deleted the feature/trade-stream branch January 9, 2022 04:22
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