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

exchanges/gateio: Add websocket order batch [SPOT] support with context mocking #1778

Open
wants to merge 188 commits into
base: master
Choose a base branch
from

Conversation

shazbert
Copy link
Collaborator

@shazbert shazbert commented Jan 17, 2025

PR Description

  • Add wrapper interface function WebsocketSubmitBatchOrders
  • Add gateio wrapper function WebsocketSubmitBatchOrders for spot only
  • Adds context mock support for websocket and REST. This is just a basic POC implementation, in future we could take in an interface to our mock server but for now what you put in is what it is going to return. The websocket specifically will generate a mock connection when you get the connection for the request itself, so no need setup or connect, but will allow the full return functionality to be tested for an exchange wrapper. This can be run during live testing as well complimentary for both rest and WS and full coverage can be obtained.

Futures not done just to keep this as small as possible and I haven't done any trading batch wise to verify it yet.

Requires #1603

Type of change

Please delete options that are not relevant and add an x in [] as item is complete.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and
also consider improving test coverage whilst working on a certain feature or package.

  • go test ./... -race
  • golangci-lint run
  • Test X

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally and on Github Actions with my changes
  • Any dependent changes have been merged and published in downstream modules

shazbert added 30 commits July 14, 2024 16:13
…larity on purpose. Change connections map to point to candidate to track subscriptions for future dynamic connections holder and drop struct ConnectionDetails.
…rror but websocket frame error or anything really makes the reader routine return and then connection never cycles and the buffer gets filled.

* Handle reconnection via an errors.Is check which is simpler and in that scope allow for quick disconnect reconnect without waiting for connection cycle.
* Dial now uses code from DialContext but just calls context.Background()
* Don't allow reader to return on parse binary response error. Just output error and return a non nil response
…would hang connection reader for eternity.
@shazbert shazbert added the nomerge requires dependency This pull request is dependent on another, so it can't be merged until the dependent one is merged label Jan 17, 2025
@shazbert shazbert self-assigned this Jan 17, 2025
@shazbert shazbert changed the title exchanges/gateio: Add websocket order batch support with context mocking exchanges/gateio: Add websocket order batch [SPOT] support with context mocking Jan 17, 2025
@shazbert shazbert added the review me This pull request is ready for review label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nomerge requires dependency This pull request is dependent on another, so it can't be merged until the dependent one is merged review me This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants