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

fix: expose error detail when swap simulation fails #5485

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

dandanlen
Copy link
Collaborator

This fixes an issue observed during the recent upgrade, when liquidity is low. Error messages were being erased due to the implementation of DispatchError.

@dandanlen dandanlen requested a review from j4m1ef0rd December 10, 2024 13:31
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

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

Project coverage is 72%. Comparing base (f969c92) to head (f6a87e4).

Files with missing lines Patch % Lines
state-chain/runtime/src/runtime_apis.rs 0% 5 Missing ⚠️
state-chain/custom-rpc/src/lib.rs 0% 3 Missing ⚠️
state-chain/runtime/src/lib.rs 0% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #5485    +/-   ##
======================================
- Coverage     72%     72%    -0%     
======================================
  Files        495     495            
  Lines      88168   88049   -119     
  Branches   88168   88049   -119     
======================================
- Hits       63152   62975   -177     
- Misses     22449   22508    +59     
+ Partials    2567    2566     -1     

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

@syan095
Copy link
Contributor

syan095 commented Dec 13, 2024

Is there still value in keepping the dispatcherror::Others variant? I believe that the original intent was for a string message to be passed through RPC back to the user. Maybe we should just replace the Other with your new type.

@syan095
Copy link
Contributor

syan095 commented Dec 13, 2024

Also a nitpick - the word "adhoc" isn't very clear on its intended purpose, or the difference between this and the other 2 variant. Maybe something like "message" or "string" or "utf8" would be clearer?

@syan095
Copy link
Contributor

syan095 commented Dec 13, 2024

Is there still value in keepping the dispatcherror::Others variant?

I suppose the variant is just there to blanket cover all the other cases (non-module, non-str)

@dandanlen dandanlen force-pushed the fix/expose-error-detail-swap-rate branch from 491f41b to f6a87e4 Compare December 13, 2024 11:53
@dandanlen dandanlen requested review from syan095 and kylezs December 16, 2024 09:16
Copy link
Contributor

@syan095 syan095 left a comment

Choose a reason for hiding this comment

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

Nice. I'm already using this in the Vault swap branch!

@dandanlen dandanlen added this pull request to the merge queue Dec 16, 2024
Merged via the queue into main with commit 8c4fd61 Dec 16, 2024
48 checks passed
@dandanlen dandanlen deleted the fix/expose-error-detail-swap-rate branch December 16, 2024 11:26
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.

2 participants