-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat(earn): prepare transactions on the collect screen and display gas #5428
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5428 +/- ##
=======================================
Coverage 86.27% 86.28%
=======================================
Files 754 754
Lines 30785 30825 +40
Branches 5257 5274 +17
=======================================
+ Hits 26559 26596 +37
- Misses 3999 4002 +3
Partials 227 227
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
7d228a8
to
7c6f4bd
Compare
7c6f4bd
to
64fd9eb
Compare
src/earn/hooks.ts
Outdated
rewards: asyncRewardsInfo.result, | ||
poolTokenAddress: poolTokenInfo.address, | ||
}) | ||
}, [asyncRewardsInfo.result]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log the error with onError from useAsync?
src/earn/hooks.ts
Outdated
const walletAddress = useSelector(walletAddressSelector) | ||
const allTokens = useTokensList() | ||
|
||
return useAsync( | ||
const asyncRewardsInfo = useAsync( | ||
async () => { | ||
if (!poolTokenInfo || !poolTokenInfo.address) { | ||
throw new Error(`Token with id ${networkConfig.aaveArbUsdcTokenId} not found`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new Error(`Token with id ${networkConfig.aaveArbUsdcTokenId} not found`) | |
throw new Error(`Token with id ${poolTokenId} not found`) |
Description
Updates hook to prepare txs after rewards info is fetched and then use prepared txs to display gas fee on the collect screen
Test plan
Unit tests, manual
earn-load-prepared-tx.mp4
Related issues
Backwards compatibility
Yes
Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will: