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

[SERVICES-1909] fix swap errors #1218

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

claudiulataretu
Copy link
Collaborator

Reasoning

  • swap query didn't return user friendly errors

Proposed Changes

  • added error handling for swap query

How to test

query Swap {
	swap(
		tokenInID: <tokenID>,
		tokenOutID: <tokenID>,
		tolerance: 0.01,
		amountOut: <amount>
	) {
		swapType
		amountIn
		amountOut
		fees
		pricesImpact
		tokenInExchangeRate
		tokenOutExchangeRate
	}
}
  • query should return error if no route found for multi swap
  • query should return error on swap output type if amount is grater than reserves

Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (e01d7b4) 56.21% compared to head (0a1a0c9) 56.25%.
Report is 1 commits behind head on development.

Additional details and impacted files
@@               Coverage Diff               @@
##           development    #1218      +/-   ##
===============================================
+ Coverage        56.21%   56.25%   +0.04%     
===============================================
  Files              235      235              
  Lines             7838     7844       +6     
  Branches           519      522       +3     
===============================================
+ Hits              4406     4413       +7     
+ Misses            2989     2986       -3     
- Partials           443      445       +2     
Flag Coverage Δ
unittests 56.25% <45.45%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...uto-router/services/auto-router.compute.service.ts 74.32% <50.00%> (-2.07%) ⬇️
...odules/auto-router/services/auto-router.service.ts 67.93% <40.00%> (-1.36%) ⬇️

... and 1 file with indirect coverage changes

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

@claudiulataretu claudiulataretu merged commit 223d79e into development Nov 8, 2023
2 of 3 checks passed
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