brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.84k stars 2.33k forks source link

Add `base::expected<>`-style API to the "fetch balance" flow #28793

Closed Miyayes closed 1 year ago

Miyayes commented 1 year ago

Most important is balance related.

Miyayes commented 1 year ago

@szilardszaloki Would you be able to rename this issue to something more specific, now that you made some definite changes? :)

kjozwiak commented 1 year ago

The above requires 1.50.94 or higher for 1.50.x verification 👍

LaurenWags commented 1 year ago

Verified with

Brave | 1.50.102 Chromium: 111.0.5563.116 (Official Build) beta (x86_64)
-- | --
Revision | ade86b9472831e26d87fd569e04b404be01e1e2b-refs/branch-heads/5563@{#1209}
OS | macOS Version 12.6.3 (Build 21G419)
1. Before enabling rewards - PASSED - Confirmed that there is no `Balance info` displayed on the brave://rewards-internals page before enabling the rewards Screen Shot 2023-03-24 at 2 38 14 PM
2. After enabling rewards - PASSED - Confirmed that after enabling the rewards the vBAT balance is shown on the Rewards Internals page - Confirmed that the `Connect account` is shown on the brave://rewards settings page, BR panel and rewards NTP widget Example | Example | Example | Example ---- | ---- | ---- | ---- Screen Shot 2023-03-24 at 2 39 27 PM | Screen Shot 2023-03-24 at 2 39 54 PM | Screen Shot 2023-03-24 at 2 40 04 PM | Screen Shot 2023-03-24 at 2 40 13 PM
3. After connecting a custodial wallet - PASSED - Confirmed that after connecting custodian wallet, both the vBAT/external wallet balance is displayed on the Rewards Internals page - Confirmed that after connecting custodian wallet, total balance is displayed on the Rewards page, Rewards panel and Rewards NTP widget Example | Example | Example | Example ---- | ---- | ---- | ---- Screen Shot 2023-03-24 at 2 43 47 PM | Screen Shot 2023-03-24 at 2 43 53 PM | Screen Shot 2023-03-24 at 2 44 02 PM | Screen Shot 2023-03-24 at 2 44 08 PM
4. Logged out state - PASSED - Confirmed that in the logged out state,the vBAT balanceis shown only on the Rewards Internals page - Confirmed that `Logged out UI` is shown on the brave://rewards, BR panel, Rewards NTP and Tipping banner - Confirmed that `: ( You are currently logged out` text message is shown on the tipping banner Example | Example | Example | Example | Example ---- | ---- | ---- | ---- | ---- Screen Shot 2023-03-24 at 2 46 20 PM | Screen Shot 2023-03-24 at 2 46 30 PM | Screen Shot 2023-03-24 at 2 46 39 PM | Screen Shot 2023-03-24 at 2 46 46 PM | Screen Shot 2023-03-24 at 2 47 00 PM
5. Fail the fetch balance request - PASSED - Uphold wallet (pre-req: have Charles Proxy set up to return 500 error for the endpoint (https://api-sandbox.uphold.com/v0/me/cards/*) - Confirmed that spinner animation is shown for both the Rewards BAT (vBAT) and external wallet balance on brave://rewards-internals page Example | Example | Example | Example ---- | ---- | ---- | ---- Screen Shot 2023-03-24 at 2 51 48 PM | Screen Shot 2023-03-24 at 2 52 00 PM | Screen Shot 2023-03-24 at 2 52 09 PM | Screen Shot 2023-03-24 at 2 52 15 PM
6. Reset rewards - PASSED - Confirmed that after `Reset rewards` the wallet balance info is not displayed on the brave://rewards-internals page Screen Shot 2023-03-24 at 2 54 13 PM
GeetaSarvadnya commented 1 year ago

Verification PASSED on Samsung Galaxy version 12 running Bravemonoarm64.apk_1.50.101

1. Before enabling rewards - PASSED - Confirmed that there is no `Balance info` displayed on the brave://rewards-internals page before enabling the rewards ![Screenshot_20230328-170556_Brave - Beta](https://user-images.githubusercontent.com/38657976/228229796-ac949307-5249-4ea9-8de1-bcb7cacabbb4.jpg)
2. After enabling rewards - PASSED - Confirmed that after enabling the rewards the vBAT balance is shown on the Rewards Internals page - Confirmed that the `Connect account` is shown on the brave://rewards settings page, BR panel and rewards NTP widget (NA) Example | Example | Example ---- | ---- | ---- ![Screenshot_20230328-170726_Brave - Beta](https://user-images.githubusercontent.com/38657976/228229953-98fe90c5-5f66-42a7-ba50-d0d8e849c2d2.jpg) | ![Screenshot_20230328-170736_Brave - Beta](https://user-images.githubusercontent.com/38657976/228229961-b75b15a2-edc9-4bea-957c-5c3b2e562b81.jpg) | ![Screenshot_20230328-170759_Brave - Beta](https://user-images.githubusercontent.com/38657976/228229966-e788f2c0-9040-4266-bc38-eee0de788791.jpg)
3. After connecting a custodial wallet - PASSED - Confirmed that after connecting custodian wallet, both the vBAT/external wallet balance is displayed on the Rewards Internals page - Confirmed that after connecting custodian wallet, total balance is displayed on the Rewards page, Rewards panel and Rewards NTP widget (NA) Example | Example | Example ---- | ---- | ---- ![Screenshot_20230328-171222_Brave - Beta](https://user-images.githubusercontent.com/38657976/228230413-70df5d51-677d-4685-ae65-422551ace1d2.jpg) | ![Screenshot_20230328-171233_Brave - Beta](https://user-images.githubusercontent.com/38657976/228230421-8b0f56a6-6cb7-4e1f-8bb8-5fb97d8f248f.jpg) | ![Screenshot_20230328-171240_Brave - Beta](https://user-images.githubusercontent.com/38657976/228230424-62c3fc6a-4da8-498a-ad93-bef6650cf7bc.jpg)
4. Logged out state - logged #29361 - Confirmed that in the logged out state,the vBAT balanceis shown only on the Rewards Internals page - Confirmed that `Logged out UI` is shown on the brave://rewards, BR panel, Rewards NTP (NA) and Tipping banner - Confirmed that `: ( You are currently logged out` text message is shown on the tipping banner, logged #29361 Example | Example | Example | Example ---- | ---- | ---- | ---- ![Screenshot_20230328-172339_Brave - Beta](https://user-images.githubusercontent.com/38657976/228231058-cf4f21b5-71cc-41fd-9171-341982b1eae9.jpg) | ![Screenshot_20230328-172311_Brave - Beta](https://user-images.githubusercontent.com/38657976/228231315-529ee93a-c00c-438f-a1bd-0ca3e48957b3.jpg) | ![Screenshot_20230328-172320_Brave - Beta](https://user-images.githubusercontent.com/38657976/228231326-5f6b9496-b80e-4e0f-ac1d-9fa2efa9d832.jpg) | ![Screenshot_20230328-172449_Brave - Beta](https://user-images.githubusercontent.com/38657976/228231424-7fe620d2-bc1a-4340-a2c8-a6ce4c7c7f18.jpg)
5. Fail the fetch balance request - PASSED - Uphold wallet (pre-req: have Charles Proxy set up to return 500 error for the endpoint (https://api-sandbox.uphold.com/v0/me/cards/*) - Confirmed that spinner animation is shown for both the Rewards BAT (vBAT) and external wallet balance on brave://rewards-internals page, encountered #29054 Example | Example | Example ---- | ---- | ---- ![Screenshot_20230328-172831_Brave - Beta](https://user-images.githubusercontent.com/38657976/228235103-2a81e752-ae14-47a4-b79d-6f6cf83dc9c0.jpg) | ![Screenshot_20230328-172842_Brave - Beta](https://user-images.githubusercontent.com/38657976/228235111-dfb75058-1ec3-45fc-8c61-b51ee5b28c37.jpg) | ![Screenshot_20230328-172908_Brave - Beta](https://user-images.githubusercontent.com/38657976/228235120-9bfe0871-042c-4d03-a24a-364a55d9a21d.jpg)
6. Reset rewards - PASSED - Confirmed that after `Reset rewards` the wallet balance info is not displayed on the brave://rewards-internals page Example | Example ---- | ---- ![Screenshot_20230328-173022_Brave - Beta](https://user-images.githubusercontent.com/38657976/228235490-b942a87b-75a2-476d-b369-ad0c563ccf0e.jpg) | ![Screenshot_20230328-173009_Brave - Beta](https://user-images.githubusercontent.com/38657976/228235538-1657f437-e9d1-44b8-bb79-223d8478420b.jpg)