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: Reset the staking data when switching wallets #2701

Merged
merged 11 commits into from
Jul 31, 2023

Conversation

LeifuChen
Copy link
Contributor

@LeifuChen LeifuChen commented Jul 28, 2023

Description

  1. The staking data will be reset when disconnecting the wallets
  2. The staking data will be refreshed immediately when switching the wallets
  3. The eligibility of trading rewards should be verified by staking v1 data
  4. The claimable rewards will be fetched when switching the wallets regardless of the pages
  5. Remove the redemption-related components
  6. Remove the reverse migration banner

Related issue

Kwenta/kwenta-private#19

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

@vercel
Copy link

vercel bot commented Jul 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
kwenta ✅ Ready (Inspect) Visit Preview Jul 31, 2023 6:38pm
kwenta-storybook ✅ Ready (Inspect) Visit Preview Jul 31, 2023 6:38pm

platschi
platschi previously approved these changes Jul 28, 2023
Copy link
Collaborator

@platschi platschi left a comment

Choose a reason for hiding this comment

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

Works great for both disconnecting wallet reset and refresh when switching wallets with staking balances.

Marko-roy
Marko-roy previously approved these changes Jul 28, 2023
@LeifuChen LeifuChen dismissed stale reviews from Marko-roy and platschi via 8bc6b5d July 28, 2023 20:19
@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Merging #2701 (0246757) into dev (bfc59bd) will increase coverage by 0.03%.
Report is 20 commits behind head on dev.
The diff coverage is 42.58%.

@@            Coverage Diff             @@
##              dev    Kwenta/kwenta#2701      +/-   ##
==========================================
+ Coverage   51.27%   51.30%   +0.03%     
==========================================
  Files         382      382              
  Lines       11540    11542       +2     
  Branches     2757     2748       -9     
==========================================
+ Hits         5917     5922       +5     
+ Misses       5400     5390      -10     
- Partials      223      230       +7     
Files Changed Coverage Δ
packages/app/src/components/TVChart/DataFeed.ts 21.79% <ø> (+3.04%) ⬆️
...es/app/src/sections/futures/MarketDetails/utils.ts 100.00% <ø> (ø)
...ions/futures/MobileTrade/UserTabs/PositionsTab.tsx 64.10% <0.00%> (ø)
...p/src/sections/shared/Layout/HomeLayout/Banner.tsx 43.18% <0.00%> (+3.59%) ⬆️
packages/app/src/state/staking/selectors.ts 41.61% <ø> (-0.50%) ⬇️
packages/app/src/utils/futures.ts 58.45% <ø> (-0.58%) ⬇️
packages/app/src/state/staking/actions.ts 12.94% <11.42%> (-1.59%) ⬇️
packages/app/src/queries/rates/utils.ts 30.76% <28.57%> (-2.57%) ⬇️
packages/app/src/state/wallet/actions.ts 36.84% <50.00%> (+1.54%) ⬆️
packages/app/src/state/staking/reducer.ts 35.00% <62.50%> (+0.16%) ⬆️
... and 14 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

packages/app/src/state/staking/actions.ts Outdated Show resolved Hide resolved
packages/app/src/state/staking/actions.ts Outdated Show resolved Hide resolved
packages/app/src/state/staking/actions.ts Outdated Show resolved Hide resolved
packages/app/src/state/staking/actions.ts Outdated Show resolved Hide resolved
packages/app/src/state/staking/actions.ts Outdated Show resolved Hide resolved
packages/app/src/state/staking/actions.ts Outdated Show resolved Hide resolved
packages/app/src/state/staking/types.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@platschi platschi left a comment

Choose a reason for hiding this comment

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

Works good here 🙏🏼

@platschi platschi merged commit b48959f into dev Jul 31, 2023
5 of 6 checks passed
@platschi platschi deleted the fix/staking-data-persist branch July 31, 2023 21:38
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.

4 participants