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

chore: Refactor utils into pure functions #634

Merged
merged 5 commits into from
Aug 1, 2024

Conversation

Eric-Warehime
Copy link
Collaborator

Move these util functions out of the API handler so that they can be used as library functions in dydx.
Had to move the loggers into the args, and made it so they can be supplied as nil if you don't want to hook the zap logger up.

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 62.50000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 56.59%. Comparing base (f14f732) to head (816693f).

Files Patch % Lines
providers/apis/dydx/parse.go 60.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #634      +/-   ##
==========================================
- Coverage   56.59%   56.59%   -0.01%     
==========================================
  Files         254      254              
  Lines       13416    13420       +4     
==========================================
+ Hits         7593     7595       +2     
- Misses       5094     5096       +2     
  Partials      729      729              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

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

it seems like we only log on error messages, so alternatively you could just:

  • return a more descriptive error (what the logger is spitting out currently)
  • and change our internal callers of those functions to log the error

@technicallyty
Copy link
Contributor

technicallyty commented Jul 31, 2024

oh nvm thats not true of all of them sadge.. maybe we could kill that log so the function sig is pretty 👉🏻👈🏻

@Eric-Warehime Eric-Warehime enabled auto-merge (squash) August 1, 2024 17:16
@Eric-Warehime Eric-Warehime merged commit 3ae948e into main Aug 1, 2024
14 checks passed
@Eric-Warehime Eric-Warehime deleted the eric/refactor-market-conversion branch August 1, 2024 17:17
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.

3 participants