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

feat(earn): prepare transactions on the collect screen and display gas #5428

Merged
merged 3 commits into from
May 18, 2024

Conversation

satish-ravi
Copy link
Contributor

@satish-ravi satish-ravi commented May 17, 2024

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:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 86.28%. Comparing base (64fd9eb) to head (41a200d).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           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           
Files Coverage Δ
src/earn/EarnCollectScreen.tsx 98.52% <100.00%> (+0.31%) ⬆️
test/utils.ts 76.78% <100.00%> (+3.31%) ⬆️
src/earn/hooks.ts 91.22% <89.28%> (+2.33%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64fd9eb...41a200d. Read the comment docs.

@satish-ravi satish-ravi force-pushed the satish/act-1180-collect-prepare-tx branch from 7d228a8 to 7c6f4bd Compare May 17, 2024 20:21
Base automatically changed from satish/act-1180-prepare-withdraw-tx to main May 17, 2024 20:55
@satish-ravi satish-ravi force-pushed the satish/act-1180-collect-prepare-tx branch from 7c6f4bd to 64fd9eb Compare May 17, 2024 21:56
@satish-ravi satish-ravi reopened this May 17, 2024
rewards: asyncRewardsInfo.result,
poolTokenAddress: poolTokenInfo.address,
})
}, [asyncRewardsInfo.result])
Copy link
Collaborator

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?

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`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
throw new Error(`Token with id ${networkConfig.aaveArbUsdcTokenId} not found`)
throw new Error(`Token with id ${poolTokenId} not found`)

@satish-ravi satish-ravi added this pull request to the merge queue May 18, 2024
Merged via the queue into main with commit ede24ec May 18, 2024
16 checks passed
@satish-ravi satish-ravi deleted the satish/act-1180-collect-prepare-tx branch May 18, 2024 02:55
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.

None yet

2 participants