- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.4k
feat: rwds-276 show rewards balance #37361
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
base: main
Are you sure you want to change the base?
Conversation
| CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. | 
| 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [0d38064]
 UI Startup Metrics (1272 ± 83 ms)
 | 
0d38064    to
    b1f1847      
    Compare
  
    | 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [b1f1847]
 UI Startup Metrics (1280 ± 76 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
 | 
b1f1847    to
    e43a1b9      
    Compare
  
    | 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [e43a1b9]
 UI Startup Metrics (1284 ± 85 ms)
 | 
e43a1b9    to
    08dc827      
    Compare
  
    | 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [08dc827]
 UI Startup Metrics (1240 ± 77 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
 | 
| I have read the CLA Document and I hereby sign the CLA | 
| 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [979f7ea]
 UI Startup Metrics (1258 ± 80 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
 | 
9e54f7f    to
    dbdf7b3      
    Compare
  
    | 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [dbdf7b3]
 UI Startup Metrics (1255 ± 88 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
 | 
| 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [aa517e9]
 UI Startup Metrics (1269 ± 104 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
 | 
b0e0de6    to
    7011f97      
    Compare
  
    | 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [7011f97]
 UI Startup Metrics (1222 ± 102 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
 | 
| 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [1e17376]
 UI Startup Metrics (1295 ± 88 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
 | 
3a30a8d    to
    ebfd5fe      
    Compare
  
    | expect(mockSubmitRequestToBackground).toHaveBeenCalledWith( | ||
| 'getRewardsSeasonStatus', | ||
| ['test-subscription-id', undefined], | ||
| ); | 
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.
Bug: Mocking Error Causes Undefined Season ID
The useSeasonStatus tests incorrectly mock submitRequestToBackground to always return a SeasonStatusState. The getRewardsSeasonMetadata call expects a SeasonDtoState with a top-level id. This type mismatch causes the season ID to be undefined when passed to getRewardsSeasonStatus, and the tests then incorrectly assert this undefined value.
| 📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI | 
| Builds ready [ebfd5fe]
 UI Startup Metrics (1266 ± 69 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
 | 
Description
UI components/hook needed to show rewards balance
Changelog
CHANGELOG entry: show rewards balance
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/RWDS-276
Screenshots/Recordings
After
TODO
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Adds rewards points balance badge to Wallet Overview backed by new rewards context/hooks, shared types, background calls, i18n, and tests.
RewardsPointsBalancecomponent showing localized points or opt-in badge with new icon; render inwallet-overview/coin-overview.tsxwhen rewards enabled.RewardsProvideranduseRewardsContextto surfacecandidateSubscriptionIdand season status.useRewardsEnabled,useCandidateSubscriptionId,useSeasonStatusfor feature gating and data fetching.metamask-controller:getCandidateSubscriptionId,getRewardsSeasonMetadata,getRewardsSeasonStatus.shared/types/rewardsand update controller/types/tests to import from shared.metamask-rewards-points.svgand new messages:rewardsOptIn,rewardsPointsBalance,rewardsPointsIconinenanden_GB.RewardsPointsBalanceand hooks (useRewardsEnabled,useCandidateSubscriptionId,useSeasonStatus).Written by Cursor Bugbot for commit ebfd5fe. This will update automatically on new commits. Configure here.