brave / brave-browser

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

Remove `std::function<>` from the `Ledger::FetchBalance()` flow #24051

Closed szilardszaloki closed 2 years ago

szilardszaloki commented 2 years ago

Part1 of https://github.com/brave/brave-browser/issues/18560.

LaurenWags commented 2 years ago

Verified with

Brave | 1.43.78 Chromium: 104.0.5112.102 (Official Build) beta (x86_64)
-- | --
Revision | 8e5396254975ef939f2ef7d0bd334e48a052b536-refs/branch-heads/5112@{#1478}
OS | macOS Version 12.5.1 (Build 21G83)

Verified test plan from https://github.com/brave/brave-core/pull/14094#issue-1299258495

Note, all test cases were checked with BraveRewardsWebUiPanelStudy:Enabled to do extra testing for https://github.com/brave/brave-browser/issues/22423.

Anon - PASSED - Confirmed able to fetch and claim promotions - Confirmed vBAT display is as expected ``` [ REQUEST ] > URL: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&platform=osx > Method: GET [ RESPONSE - OnRequest ] > Url: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&platform=osx > Result: Success > HTTP Code: 200 > Body: {"promotions":[{"id":"f05568e6-f4a1-4438-8e81-cc0490fd14f7","createdAt":"2022-07-05T16:19:25.919928Z","expiresAt":"2022-10-05T16:19:25.919928Z","version":5,"suggestionsPerGrant":120,"approximateValue":"30","type":"ugp","available":true,"platform":"desktop","publicKeys":["6AphTvx13IgxVRG1nljV2ql1Y7yGUol6yrVMhEP85wI="],"legacyClaimed":false,"claimableUntil":"2022-10-05T16:19:25.919928Z"}]} ......... [ REQUEST ] > URL: https://grant.rewards.bravesoftware.com/v1/promotions/f05568e6-f4a1-4438-8e81-cc0490fd14f7 > Method: POST > Content: {"blindedCreds":["5iOU4zXCmkSe....... [11932:259:0822/150631.123059:VERBOSE6:logging_util.cc(137)] [ RESPONSE - OnRequest ] > Url: https://grant.rewards.bravesoftware.com/v1/promotions/f05568e6-f4a1-4438-8e81-cc0490fd14f7 > Result: Success > HTTP Code: 200 > Body: {"claimId":"856ee547-d1dd-421c-a7ed-704067050c1c"} ``` Example | Example | Example ----- | ----- | ----- Screen Shot 2022-08-22 at 3 10 39 PM | Screen Shot 2022-08-22 at 3 11 13 PM | Screen Shot 2022-08-22 at 3 11 20 PM
Uphold - PASSED - Confirmed able to link KYC'd Uphold account - Confirmed balance was displayed as expected Example | Example | Example ----- | ----- | ----- Screen Shot 2022-08-22 at 3 47 57 PM | Screen Shot 2022-08-22 at 3 48 26 PM | Screen Shot 2022-08-22 at 3 49 15 PM
Brave | 1.43.79 Chromium: 104.0.5112.102 (Official Build) beta (x86_64)
-- | --
Revision | 8e5396254975ef939f2ef7d0bd334e48a052b536-refs/branch-heads/5112@{#1478}
OS | macOS Version 12.5.1 (Build 21G83)
bitFlyer - PASSED - Confirmed able to link KYC'd bitFlyer account - Confirmed balance was displayed as expected Example | Example | Example ----- | ----- | ----- スクリーンショット 2022-08-23 9 34 12 | スクリーンショット 2022-08-23 9 35 24 | スクリーンショット 2022-08-23 9 35 45
Gemini - PASSED - Confirmed able to link KYC'd Gemini account - Confirmed balance was displayed as expected Example | Example | Example ----- | ----- | ----- Screen Shot 2022-08-23 at 11 12 16 AM | Screen Shot 2022-08-23 at 11 12 41 AM | Screen Shot 2022-08-23 at 11 14 40 AM

Additional testing with tipping was done for anon, Uphold, Gemini, and bitFlyer rewards as per https://github.com/brave/brave-browser/issues/20748#issuecomment-1209456917 (both successful and pending tips). Each case confirmed that the tip was successful (and deducted from balance as expected) or put in pending list as per what the case called for.


Verification PASSED on

Brave | 1.43.78 Chromium: 104.0.5112.102 (Official Build) beta (64-bit)
-- | --
Revision | 8e5396254975ef939f2ef7d0bd334e48a052b536-refs/branch-heads/5112@{#1478}
OS | Windows 10 Version 21H2 (Build 19044.1889)
Uni-verse commented 2 years ago

Verified on Samsung Galaxy S21 running Android 12 using build version:

Brave   1.43.81 Chromium: 104.0.5112.102 (Official Build) (64-bit) 
Revision    8e5396254975ef939f2ef7d0bd334e48a052b536-refs/branch-heads/5112@{#1478}
OS  Android 12; Build/SP1A.210812.016

Test Plan: https://github.com/brave/brave-core/pull/14094#issue-1299258495

Anon - Confirmed able to fetch and claim promotions - Confirmed vBAT display is as expected Example | Example -|- ![screenshot-1661454339044](https://user-images.githubusercontent.com/17885425/186764008-756607f3-a9a9-4998-9f85-5a26eaca25a9.png) | ![screenshot-1661454127963](https://user-images.githubusercontent.com/17885425/186764165-8d4d79de-0952-468c-a784-97b453e6b089.png)
Uphold - Confirmed able to link KYC'd Uphold account - Confirmed balance was displayed as expected Example | Example | Example -|-|- ![screenshot-1661456877077](https://user-images.githubusercontent.com/17885425/186763053-8450df58-4864-4e5f-b1a5-4e0cc2001e7f.png) | ![screenshot-1661456340613](https://user-images.githubusercontent.com/17885425/186760114-9ea7a492-3b85-4629-bf30-5bad67a986ec.png) | ![screenshot-1661456392643](https://user-images.githubusercontent.com/17885425/186760123-f1eac51d-5612-450d-8539-923435b611cf.png)
Gemini - Confirmed able to link KYC'd Gemini account - Confirmed balance was displayed as expected Example | Example | Example -|-|- ![screenshot-1661456703672](https://user-images.githubusercontent.com/17885425/186763284-85c6c864-1bb2-4084-ad90-4f4fa7fc2fa6.png) | ![screenshot-1661456779390](https://user-images.githubusercontent.com/17885425/186760285-6f33d360-34c2-4dca-8f80-b2290183c716.png) | ![screenshot-1661457009124](https://user-images.githubusercontent.com/17885425/186762338-ae8b8194-d8f0-4491-aad4-0309241630d4.png)
Bitflyer - Confirmed able to link KYC'd Bitflyer account - Confirmed balance was displayed as expected Example | Example | Example -|-|- ![screenshot-1661457435858](https://user-images.githubusercontent.com/17885425/186763788-922fd4cd-0308-4379-af62-1e55c006f356.png) | ![screenshot-1661457355199](https://user-images.githubusercontent.com/17885425/186763811-3a2bb16d-1ba5-46d3-af49-bf3d69b3cec9.png) | ![screenshot-1661457501225](https://user-images.githubusercontent.com/17885425/186763830-c2a9404a-3784-46c0-9436-edde6c585a5c.png)
MadhaviSeelam commented 2 years ago

Verification PASSED using

Brave | 1.43.82 Chromium: 105.0.5195.58 (Official Build) (64-bit) 
Revision | 1907e1693887af4463221a10247360b7a056db49-refs/branch-heads/5195_47@{#3}
OS | Linux

Verified test plan from https://github.com/brave/brave-core/pull/14094#issue-1299258495

Note, all test cases were checked with BraveRewardsWebUiPanelStudy:Enabled

Anon - PASSED - Confirmed able to fetch and claim promotions - Confirmed vBAT display is as expected ``` [ REQUEST ] > URL: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&paymentId=b0bfc4dd-5508-4f18-8266-4df0825cec3c&platform=linux > Method: GET [10279:10279:0826/115427.160848:VERBOSE1:uphold.cc(114)] Uphold wallet is not VERIFIED. [10279:10279:0826/115427.188098:VERBOSE6:logging_util.cc(137)] [ RESPONSE - OnRequest ] > Url: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&paymentId=b0bfc4dd-5508-4f18-8266-4df0825cec3c&platform=linux > Result: Success > HTTP Code: 200 > Body: {"promotions":[{"id":"f05568e6-f4a1-4438-8e81-cc0490fd14f7","createdAt":"2022-07-05T16:19:25.919928Z","expiresAt":"2022-10-05T16:19:25.919928Z","version":5,"suggestionsPerGrant":120,"approximateValue":"30","type":"ugp","available":true,"platform":"desktop","publicKeys":["6AphTvx13IgxVRG1nljV2ql1Y7yGUol6yrVMhEP85wI="],"legacyClaimed":false,"claimableUntil":"2022-10-05T16:19:25.919928Z"}]} ``` ``` [ REQUEST ] > URL: https://grant.rewards.bravesoftware.com/v1/promotions/f05568e6-f4a1-4438-8e81-cc0490fd14f7 > Method: POST > Content: {"blindedCreds":["qlRRW7bUQEI3vC.... [10279:10279:0826/115405.905540:VERBOSE6:logging_util.cc(137)] [ RESPONSE - OnRequest ] > Url: https://grant.rewards.bravesoftware.com/v1/promotions/f05568e6-f4a1-4438-8e81-cc0490fd14f7 > Result: Success > HTTP Code: 200 > Body: {"claimId":"b4c0c35a-d4a8-4060-8a18-b543b57d2fca"} ``` Ex1|Ex2|Ex3|Ex4 ---|---|---|--- image 1|image 1|image 1|image 1
Uphold - PASSED - Confirmed able to link KYC'd Uphold account - Confirmed balance was displayed as expected Ex1|Ex2|Ex3|Ex4 ----|---|----|---- image 1|image 1|image 1|image 1
Gemini - PASSED - Confirmed able to link KYC'd Gemini account - Confirmed balance was displayed as expected Ex1|Ex2|Ex3|Ex4 ---|---|---|--- image 1|image 1|image 1|image 1
bitFlyer - PASSED - Confirmed able to link KYC'd bitFlyer account - Confirmed balance was displayed as expected Ex1|Ex2|Ex3|Ex4 ---|---|---|--- |image 1|image 1|image 1|image 1