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

refactor: split subscribe ticker and candle channels #610

Merged
merged 14 commits into from
Mar 7, 2022

Conversation

RafilxTenfen
Copy link
Contributor

@RafilxTenfen RafilxTenfen commented Mar 7, 2022

Description

  • Split subscription of ticker and candle channels for the following providers: Okx, Binance, Huobi, and Kraken
  • Add error check for websocket.CloseAbnormalClosure to Kraken when EOF occurs to avoid having the following
    image

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added appropriate labels to the PR
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Copy link
Collaborator

@adamewozniak adamewozniak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just left a few minor suggestions - let's merge this before #611

price-feeder/oracle/provider/binance.go Outdated Show resolved Hide resolved
price-feeder/oracle/provider/binance.go Outdated Show resolved Hide resolved
price-feeder/oracle/provider/binance.go Outdated Show resolved Hide resolved
price-feeder/oracle/provider/binance.go Outdated Show resolved Hide resolved
price-feeder/oracle/provider/binance.go Outdated Show resolved Hide resolved
price-feeder/oracle/provider/binance.go Outdated Show resolved Hide resolved
price-feeder/oracle/provider/provider.go Outdated Show resolved Hide resolved
RafilxTenfen and others added 3 commits March 7, 2022 09:44
Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com>
…ork/umee into rafilx/subscribe-ticker-candle
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just one minor nit

price-feeder/oracle/provider/provider.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@adamewozniak adamewozniak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - what do you think about adding SubscribeCurrencyPairs to the interface?

@RafilxTenfen
Copy link
Contributor Author

LGTM - what do you think about adding SubscribeCurrencyPairs to the interface?

I thought about that, but what about Osmosis? who doesn't have websocket
@adamewozniak

@adamewozniak
Copy link
Collaborator

adamewozniak commented Mar 7, 2022

LGTM - what do you think about adding SubscribeCurrencyPairs to the interface?

I thought about that, but what about Osmosis? who doesn't have websocket @adamewozniak

Could put in a no-op, not sure what best practice is to do here. Imo it might be easier for library users (peggo) to assume that the method will be implemented on all providers. Then again, making interfaces as least specific to implementations as possible also makes sense.
cc : @alexanderbez

@alexanderbez
Copy link
Contributor

I imagine we could add SubscribeCurrencyPairs to our interface. In osmosis and others that dont provide websockets, can we have them safely perform a no-op?

@alexanderbez
Copy link
Contributor

Shall we merge this PR or do we want to make further tweaks?

@adamewozniak
Copy link
Collaborator

Shall we merge this PR or do we want to make further tweaks?

imo we can merge, I can update the interface in #611 later today
cc : @RafilxTenfen

@alexanderbez alexanderbez merged commit d75ab49 into main Mar 7, 2022
@alexanderbez alexanderbez deleted the rafilx/subscribe-ticker-candle branch March 7, 2022 16:01
mergify bot pushed a commit that referenced this pull request Mar 7, 2022
alexanderbez pushed a commit that referenced this pull request Mar 7, 2022
(cherry picked from commit d75ab49)

Co-authored-by: Rafael Tenfen <rafaeltenfen.rt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants