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

cmd/exchange_template: Update docs #1494

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

Conversation

cranktakular
Copy link
Contributor

@cranktakular cranktakular commented Mar 8, 2024

PR Description

If the exchange config isn't enabled, then the default setup function in the wrapper won't do anything with the config passed to it, causing any authentication to not be set. And thus, causing anything which uses authentication to fail.

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)

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

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

Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 35.90%. Comparing base (d518993) to head (c09f439).
Report is 8 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1494      +/-   ##
==========================================
- Coverage   37.75%   35.90%   -1.86%     
==========================================
  Files         411      411              
  Lines      147817   177595   +29778     
==========================================
+ Hits        55815    63758    +7943     
- Misses      84218   106055   +21837     
+ Partials     7784     7782       -2     
Files Coverage Δ
cmd/exchange_template/exchange_template.go 47.00% <0.00%> (-3.62%) ⬇️

... and 386 files with indirect coverage changes

@@ -36,6 +36,7 @@ func TestMain(m *testing.M) {
{{ if .WS }} exchCfg.API.AuthenticatedWebsocketSupport = true {{ end }}
exchCfg.API.Credentials.Key = apiKey
exchCfg.API.Credentials.Secret = apiSecret
exchCfg.Enabled = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there anything else that should be changed? I only ask because there is no other TestMain in /exchanges/ that has this present and they work with authenticated endpoints. If this is an issue for them, could you update all of those?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Never mind! Vague error messages led me here, but the fundamental issue was no assets/pairs being set in configtest.json on initial generation, which is the more graceful fix in general.

Maybe we could leave a comment about that somewhere in this tool, or in the files generated by it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

All G! Yeah that's fine. Adding some details to suggest that you should populate configtest.json with asset/pairs before running tests would be good. Whether it's in ADD_NEW_EXCHANGE.md, commentary in the tool or otherwise I'm happy with. We're lacking in documentation, so any extra details is appreciated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've now done so in the printed output from running the tool. Please let me know what you think of the wording there.

@thrasher- thrasher- changed the title cmd/exchange_template: Test template fix cmd/exchange_template: Update docs Mar 11, 2024
@thrasher- thrasher- added the review me This pull request is ready for review label Mar 12, 2024
Copy link
Collaborator

@gloriousCode gloriousCode left a comment

Choose a reason for hiding this comment

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

Nice. Thanks for adding the expanded comment

@gloriousCode gloriousCode added the gcrc GloriousCode Review Complete label Mar 25, 2024
@thrasher-
Copy link
Collaborator

Will be keeping this open for additional improvements to the exchange impl tools/docs up until Bitget is finished as @cranktakular goes through it

@thrasher- thrasher- added reconstructing Based on PR feedback, this is currently being reworked and is not to be merged blocked and removed review me This pull request is ready for review labels Mar 25, 2024
@samuael
Copy link
Contributor

samuael commented Mar 26, 2024

Thank you for this change, and for keeping the PR open.
I have added small updates and created a PR here to this(👆) @cranktakular s PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked gcrc GloriousCode Review Complete reconstructing Based on PR feedback, this is currently being reworked and is not to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants