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: better handle token registration errors #44

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Conversation

sebastiendan
Copy link
Member

Description

This PR fixes the token registration error handling.

The problem was that without an explicit gasLimit, the token registration transaction would fail without clear error in case of for instance insufficient funds. This came from the lack of explicit gasLimit in that transaction sending (gas estimation isn't working well with custom params).

The PR also introduces a design change: the top-context setErrors helper function is now called in the component rather than the hook. This may be replicated to all other hooks in the future, as the presentation layer should cover the error display.

Fixes TOO-410

PR Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added or updated tests that comprehensively prove my change is effective or that my feature works

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

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

Comparison is base (6308e74) 87.64% compared to head (2825505) 88.04%.

Files Patch % Lines
packages/frontend/src/components/RegisterToken.tsx 25.00% 9 Missing ⚠️
packages/frontend/src/hooks/useRegisterToken.ts 60.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
+ Coverage   87.64%   88.04%   +0.40%     
==========================================
  Files          26       26              
  Lines        1271     1255      -16     
  Branches      124      121       -3     
==========================================
- Hits         1114     1105       -9     
+ Misses        157      150       -7     

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

@sebastiendan sebastiendan merged commit 0884437 into main Jan 19, 2024
5 of 6 checks passed
@sebastiendan sebastiendan deleted the seb/too-410 branch January 19, 2024 13:12
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.

1 participant