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

Implement vBAT submission for userdrain when user is in logged out Rewards wallet state #21588

Closed
Miyayes opened this issue Mar 10, 2022 · 3 comments · Fixed by brave/brave-core#13037
Assignees
Labels
feature/rewards OS/Android Fixes related to Android browser functionality OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass - Android Tab QA Pass-Win64 QA/Test-Plan-Specified QA/Yes release-notes/exclude

Comments

@Miyayes
Copy link
Collaborator

Miyayes commented Mar 10, 2022

Description

Currently, vBAT is only submitted to be userdrained if the user's Rewards wallet state is verified.

Solution

Make the browser also submit vBAT to be userdrained even if the user is in a logged out state.

Test Plan

  1. In Brave enable rewards and connect with an external wallet (please, test for all 3 integrations)
  2. Get wallet into a logged out state (this can be done, for example with Uphold, by disconnecting Brave integration)
  3. Make sure the walled shows Logged Out
  4. Send some vBAT to the wallet id
  5. Clam vBAT
  6. Check that the claimed vBAT shows in the balance on the rewards page
  7. Reload rewards page
  8. The vBAT claimed in step 5 should disappear from the balance
  9. Check the external wallet site: the vBAT should have arrived to the wallet (possibly with a delay if Gemini).
@GeetaSarvadnya
Copy link

GeetaSarvadnya commented May 27, 2022

Verification PASSED on

Brave | 1.40.75 Chromium: 102.0.5005.61 (Official Build) beta (64-bit)
-- | --
Revision | 0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819}
OS | Windows 10 Version 21H2 (Build 19044.1706)

Clean profile

Case 1: Uphold_Verify that browser submits the vBAT to the custodian wallets when the user is in logged out state_PASSED
  • Clean profile 1.40.x
  • Enable rewards and connect the existing KYC'd uphold wallet and note down the wallet balance
  • Get wallet into a logged out state
  • Confirm that the wallet is in the Logged out state
  • Send vBAT ad grants to the browser wallet id
  • Claim the vBAT ad grants and ensure claimed ad grants is shown in the wallet balance
  • Reload the brave://rewards page
  • Confirm that claimed vBAT is removed from the wallet balance
  • Connect to uphold the account again
  • Confirmed that claimed vBAT is moved to uphold wallet and balance is shown in the wallet
  • Confirmed that claimed vBAT is reflected in the transaction history in the uphold wallet
  • Confirmed that vBAT user drain logs are shown in the console
Uphold initial balance Logged Out Sent vBAT Claim vBAT Before page reload After page reload Uphold final balance
image (11) image (10) image (12) image (13) image (14) image (15) image (16)

Console logs for drain id after userdrain was successful

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&paymentId=.....ab19-7f8723e3eba9&platform=windows
> Method: GET
[11456:10612:0603/131111.825:VERBOSE1:uphold.cc(114)] Uphold wallet is not VERIFIED.
[11456:10612:0603/131111.831:VERBOSE5:ledger_impl.cc(114)]
[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
> Method: POST
> Content: {"credentials":[{"publicKey":"CCJSODC....rTTKiglvrw=="}],"paymentId":"...ab19-7f8723e3eba9"}
> Content Type: application/json; charset=utf-8
> Header digest: SHA-256=am874V88raAN4aMk63Hsw42QwX8o2e+ua4hlF8ZK7PQ=
> Header signature: keyId="8a0ab2eb-9ef3-4a7c-ab19-7f8723e3eba9",algorithm="ed25519",headers="digest (request-target)",signature="n4cNJMrzGwhorcBjznAzNTWDvw+8wy5YtX7+8Lbq7drPutSF5q8gcd8j4QgkTcw8hrNezeIKWb6HOt9szpHvDQ=="
> Header accept: application/json
[11456:10612:0603/131111.856:VERBOSE6:logging_util.cc(137)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&paymentId=.....ab19-7f8723e3eba9&platform=windows
> Result: Success
> HTTP Code: 200
> Body: {"promotions":[{"id":"f05568e6-f4a1-4438-8e81-cc0490fd14f7","createdAt":"2022-04-12T16:02:19.900576Z","expiresAt":"2022-07-12T16:02:19.900576Z","version":5,"suggestionsPerGrant":120,"approximateValue":"30","type":"ugp","available":true,"platform":"desktop","publicKeys":["6AphTvx13IgxVRG1nljV2ql1Y7yGUol6yrVMhEP85wI="],"legacyClaimed":false,"claimableUntil":"2022-07-12T16:02:19.900576Z"},{"id":"7535c8b7-b8ee-4c7b-9f0e-1a532a651497","createdAt":"2022-06-03T07:39:21.776497Z","expiresAt":"2022-10-03T07:39:21.776497Z","version":5,"suggestionsPerGrant":8,"approximateValue":"2","type":"ads","available":true,"platform":"desktop","publicKeys":["CCJSODC4wXPrPhQ04rXhtsbU9oJrAwmasYLmvarPXE4="],"legacyClaimed":false,"claimableUntil":"2022-09-03T07:39:21.776497Z"}]}

[11456:10612:0603/131112.471:VERBOSE6:logging_util.cc(137)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
> Result: Success
> HTTP Code: 200
> Body: {"drainId":"465d27ca-fbd3-4dea-ad03-d72420966dde"}

claimed vBAT is reflected in the transaction history in the uphold wallet
image (17)

Case 2: Gemini_Verify that the browser submits the vBAT to the custodian wallets when the user is in logged out state_PASSED
  • Clean profile 1.40.x
  • Enable rewards and connect the existing KYC'd Gemini wallet and note down the wallet balance
  • Get wallet into a logged out state
  • Confirm that the wallet is in the Logged out state
  • Send vBAT ad grants to the browser wallet id
  • Claim the vBAT ad grants and ensure claimed ad grants is shown in the wallet balance
  • Reload the brave://rewards page
  • Confirm that claimed vBAT is removed from the wallet balance
  • Connect to Gemini the account again
  • Confirmed that claimed vBAT is moved to Gemini wallet and balance is shown in the wallet
  • Confirmed that vBAT user drain logs are shown in the console
Gemini initial balance Logged Out Sent vBAT Claim vBAT Before page reload After page reload Gemini final balance
image image image image image image image

Console logs for drain id after userdrain was successful

[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
> Method: POST
> Content: {"credentials":[{"publicKey":"MrFkU7Vb5....0EBA=="}],"paymentId":".....7c0111260cc1"}
> Content Type: application/json; charset=utf-8
> Header digest: SHA-256=bGelAnIsR96+56ANJ0hzUKK7HCHFQV6WS/P+5JKoFoA=
> Header signature: keyId="05030939-a751-44aa-b445-7c0111260cc1",algorithm="ed25519",headers="digest (request-target)",signature="MpRNAb2D7eQcELOh12XUJGOnK3vkWi3zf4+sKqA1iFAMr5Lvlxoi1HdUOuSul+0mJKKEen/ugHhqbwZ67TDpDQ=="
> Header accept: application/json
[15532:17796:0603/160647.477:VERBOSE1:browser_manager.cc(65)] Browser did resign active
[15532:17796:0603/160647.477:VERBOSE6:user_activity.cc(48)] Triggered event: 17 (34.5:2:3600 s)
[15532:17796:0603/160647.484:VERBOSE6:logging_util.cc(137)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&paymentId=.....7c0111260cc1&platform=windows
> Result: Success
> HTTP Code: 200
> Body: {"promotions":[{"id":"f05568e6-f4a1-4438-8e81-cc0490fd14f7","createdAt":"2022-04-12T16:02:19.900576Z","expiresAt":"2022-07-12T16:02:19.900576Z","version":5,"suggestionsPerGrant":120,"approximateValue":"30","type":"ugp","available":true,"platform":"desktop","publicKeys":["6AphTvx13IgxVRG1nljV2ql1Y7yGUol6yrVMhEP85wI="],"legacyClaimed":false,"claimableUntil":"2022-07-12T16:02:19.900576Z"},{"id":"915aa5ee-7490-4b14-a198-b9d142f62213","createdAt":"2022-06-03T10:33:23.582839Z","expiresAt":"2022-10-03T10:33:23.582839Z","version":5,"suggestionsPerGrant":8,"approximateValue":"2","type":"ads","available":true,"platform":"desktop","publicKeys":["MrFkU7Vb59spfT5/57xjM0S7s7lY99PLBPRThtFHkFA="],"legacyClaimed":false,"claimableUntil":"2022-09-03T10:33:23.582839Z"}]}

[15532:17796:0603/160648.312:VERBOSE6:logging_util.cc(137)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
> Result: Success
> HTTP Code: 200
> Body: {"drainId":"23a19a00-5cf7-47cf-ad76-9460cf826543"}

[15532:17796:0603/160648.315:VERBOSE6:logging_util.cc(137)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
> Result: Success
> HTTP Code: 200
> Body: {"drainId":"02fe13dd-5dfe-41e9-a139-1a92ed248768"}

Console logs for balance update

[ REQUEST ]
> URL: https://api.sandbox.gemini.com/v1/balances
> Method: POST
[15532:17796:0603/161356.258:VERBOSE6:logging_util.cc(137)]
[ RESPONSE - OnRequest ]
> Url: https://api.sandbox.gemini.com/v1/balances
> Result: Success
> HTTP Code: 200
> Body: [{"type":"exchange","currency":"LTC","amount":"20000","available":"20000","availableForWithdrawal":"20000"},{"type":"exchange","currency":"ETH","amount":"20000","available":"20000","availableForWithdrawal":"20000"},{"type":"exchange","currency":"BTC","amount":"1000","available":"1000","availableForWithdrawal":"1000"},{"type":"exchange","currency":"ZEC","amount":"20000","available":"20000","availableForWithdrawal":"20000"},{"type":"exchange","currency":"BCH","amount":"20000","available":"20000","availableForWithdrawal":"20000"},{"type":"exchange","currency":"BAT","amount":"1479.6","available":"1479.6","availableForWithdrawal":"1479.6"},{"type":"exchange","currency":"USD","amount":"100000.00","available":"100000.00","availableForWithdrawal":"100000.00"}]
Case 3: bitFlyer_Verify that browser submits the vBAT to the custodian wallets when the user is in logged out state_PASSED
  • Clean profile 1.40.x
  • Enable rewards and connect the existing KYC'd bitFlyer wallet and note down the wallet balance
  • Get wallet into a logged out state
  • Confirm that the wallet is in the Logged out state
  • Send vBAT ad grants to the browser wallet id
  • Claim the vBAT ad grants and ensure claimed ad grants is shown in the wallet balance
  • Reload the brave://rewards page
  • Confirm that claimed vBAT is removed from the wallet balance
  • Connect to bitFlyer the account again
  • Confirmed that claimed vBAT is moved to bitFlyer wallet and balance is shown in the wallet
  • Confirmed that vBAT user drain logs are shown in the console
bitFlyer initial balance Logged Out Sent vBAT Claim vBAT Before page reload After page reload bitFlyer final balance
image image image image image image image

Console logs for balance update

[ REQUEST ]
> URL: https://demo24kiuw4dcyncsy3qlud8u8.azurewebsites.net/api/link/v1/account/
inventory
> Method: GET
[3816:3820:0605/073441.034:VERBOSE1:browser_manager.cc(77)] Browser did enter fo
reground
[3816:3820:0605/073441.035:VERBOSE6:user_activity.cc(48)] Triggered event: 01 (2
2:2:3600 s)
[3816:3820:0605/073441.036:VERBOSE1:browser_manager.cc(53)] Browser did become a
ctive
[3816:3820:0605/073441.040:VERBOSE6:user_activity.cc(48)] Triggered event: 16 (2
2:2:3600 s)
[3816:3820:0605/073441.274:VERBOSE2:tab_manager.cc(131)] Tab id 9 was closed
[3816:3820:0605/073441.276:VERBOSE6:user_activity.cc(48)] Triggered event: 08 (2
3:2:3600 s)
[3816:3820:0605/073441.276:VERBOSE2:tab_manager.cc(131)] Tab id 8 was closed
[3816:3820:0605/073441.276:VERBOSE6:user_activity.cc(48)] Triggered event: 08 (2
4:2:3600 s)
[3816:3820:0605/073441.276:VERBOSE2:tab_manager.cc(131)] Tab id 7 was closed
[3816:3820:0605/073441.280:VERBOSE6:user_activity.cc(48)] Triggered event: 08 (2
5:2:3600 s)
[3816:3820:0605/073441.281:VERBOSE2:tab_manager.cc(131)] Tab id 5 was closed
[3816:3820:0605/073441.281:VERBOSE6:user_activity.cc(48)] Triggered event: 08 (2
6:2:3600 s)
[3816:3820:0605/073441.282:VERBOSE2:tab_manager.cc(131)] Tab id 4 was closed
[3816:3820:0605/073441.282:VERBOSE6:user_activity.cc(48)] Triggered event: 08 (2
7:2:3600 s)
[3816:3820:0605/073441.283:VERBOSE2:tab_manager.cc(131)] Tab id 3 was closed
[3816:3820:0605/073441.283:VERBOSE6:user_activity.cc(48)] Triggered event: 08 (2
8:2:3600 s)
[3816:3820:0605/073441.283:VERBOSE2:tab_manager.cc(131)] Tab id 2 was closed
[3816:3820:0605/073441.284:VERBOSE6:user_activity.cc(48)] Triggered event: 08 (2
9:2:3600 s)
[3816:3820:0605/073441.287:VERBOSE1:browser_manager.cc(89)] Browser did enter ba
ckground
[3816:3820:0605/073441.287:VERBOSE6:user_activity.cc(48)] Triggered event: 02 (2
9.5:2:3600 s)
[3816:3820:0605/073441.291:VERBOSE6:logging_util.cc(137)]
[ RESPONSE - OnRequest ]
> Url: https://demo24kiuw4dcyncsy3qlud8u8.azurewebsites.net/api/link/v1/account/
inventory
> Result: Success
> HTTP Code: 200
> Body: {
  "account_hash": "7e25dfa49c1a798591cad4a85511834135468a9c",
  "inventory": [
    {
      "currency_code": "JPY",
      "amount": 0.0,
      "available": 0.0
    },
 "currency_code": "BAT",
 "amount": 118.35,
 "available": 118.350000000000

Additional checks

  • Confirmed users can send a one-time tip/recurring tip using the user drained vBAT via Uphold/Gemini/bitFlyer custodians
  • Confirmed users can perform the auto-contribution using vBAT via Uphold custodian
Uphold Gemini bitFlyer
image image image

@aman-m1
Copy link

aman-m1 commented Jun 6, 2022

@Miyayes Will this work for a user who was verified before but got unverified after Rewards wallet verification with Uphold and Gemini got disabled but Uphold and Gemini still offer their services, say, in India? Meaning, Ad rewards would continue to be deposited in their custodial accounts?

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Jun 15, 2022

Verification PASSED on Samsung Galaxy Tab A7 version 11 running Bravemonoarmx64.apk_1.40.99

Clean profile

Case 1: Uphold_Verify that browser submits the vBAT to the custodian wallets when the user is in logged out state_PASSED
  • Clean profile 1.40.x
  • Enable rewards and connect the existing KYC'd uphold wallet and note down the wallet balance
  • Get wallet into a logged out state
  • Confirm that the wallet is in the Logged out state
  • Send vBAT ad grants to the browser wallet id
  • Claim the vBAT ad grants and ensure claimed ad grants is shown in the wallet balance
  • Reload the brave://rewards page
  • Confirm that claimed vBAT is removed from the wallet balance
  • Connect to uphold the account again
  • Confirmed that claimed vBAT is moved to uphold wallet and balance is shown in the wallet
  • Confirmed that claimed vBAT is reflected in the transaction history in the uphold wallet
  • Confirmed that vBAT user drain logs are shown in the console
Uphold initial balance Logged Out Sent vBAT Claim vBAT Before page reload After page reload Uphold final balance
Screenshot_20220615-130157_Brave - Beta Screenshot_20220615-130444_Brave - Beta Screenshot_20220615-131602_Brave - Beta Screenshot_20220615-131626_Brave - Beta Screenshot_20220615-131653_Brave - Beta Screenshot_20220615-131732_Brave - Beta Screenshot_20220615-131837_Brave - Beta

claimed vBAT is reflected in the transaction history in the uphold wallet:
Screenshot_20220615-131938_Brave - Beta

Case 2: Gemini_Verify that the browser submits the vBAT to the custodian wallets when the user is in logged out state_PASSED
  • Clean profile 1.40.x
  • Enable rewards and connect the existing KYC'd Gemini wallet and note down the wallet balance
  • Get wallet into a logged out state
  • Confirm that the wallet is in the Logged out state
  • Send vBAT ad grants to the browser wallet id
  • Claim the vBAT ad grants and ensure claimed ad grants is shown in the wallet balance
  • Reload the brave://rewards page
  • Confirm that claimed vBAT is removed from the wallet balance
  • Connect to Gemini the account again
  • Confirmed that claimed vBAT is moved to Gemini wallet and balance is shown in the wallet
  • Confirmed that vBAT user drain logs are shown in the console
Gemini initial balance Logged Out Sent vBAT Claim vBAT Before page reload After page reload Gemini final balance
Screenshot_20220615-151723_Brave - Beta Screenshot_20220615-151829_Brave - Beta Screenshot_20220615-152137_Brave - Beta Screenshot_20220615-152157_Brave - Beta Screenshot_20220615-152209_Brave - Beta Screenshot_20220615-151829_Brave - Beta Screenshot_20220615-152439_Brave - Beta

Console logs for drain id after userdrain was successful

 [ REQUEST ]
    > URL: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&paymentId=c2782fd5-67ca-44cd-ae35-9eafbd7dd0e9&platform=android
    > Method: GET
2022-06-15 15:22:13.929 16505-16505/? V/chromium: [VERBOSE1:uphold.cc(114)] Uphold wallet is not VERIFIED.
2022-06-15 15:22:13.956 16505-16505/? V/chromium: [VERBOSE1:conversions.cc(223)] URL is not supported for conversions
2022-06-15 15:22:13.956 16505-16505/? V/chromium: [VERBOSE1:ads_impl.cc(207)] Visited URL is not supported
2022-06-15 15:22:14.017 16505-16505/? V/chromium: [VERBOSE5:ledger_impl.cc(114)] 
    [ REQUEST ]
    > URL: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
    > Method: POST
    > Content: {"credentials":[{"publicKey":"```"}
    > Content Type: application/json; charset=utf-8
    > Header digest: SHA-256=+yKe2O8Z04BzeMBWPRd4mZEPCNoUO0KDZCauTjTYrkU=
    > Header signature: keyId="c2782fd5-67ca-44cd-ae35-9eafbd7dd0e9",algorithm="ed25519",headers="digest (request-target)",signature="EF9JhobJwAQC4/X+x2F4FA/eTMpW4IZlPErs/QItDM/enpPfeHgmNx1V3AZKRrHrsdb/XYJvGi8Sviy9PRRsDA=="
    > Header accept: application/json
2022-06-15 15:22:14.061 16505-16505/? V/chromium: [VERBOSE5:ledger_impl.cc(114)] 
    [ REQUEST ]
    > URL: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
    > Method: POST
    > Content: {"credentials":[{"publicKey":"Lt+..."}
    > Content Type: application/json; charset=utf-8
    > Header digest: SHA-256=+yKe2O8Z04BzeMBWPRd4mZEPCNoUO0KDZCauTjTYrkU=
    > Header signature: keyId="c2782fd5-67ca-44cd-ae35-9eafbd7dd0e9",algorithm="ed25519",headers="digest (request-target)",signature="EF9JhobJwAQC4/X+x2F4FA/eTMpW4IZlPErs/QItDM/enpPfeHgmNx1V3AZKRrHrsdb/XYJvGi8Sviy9PRRsDA=="
    > Header accept: application/json
2022-06-15 15:22:14.063 16505-16505/? V/chromium: [VERBOSE6:logging_util.cc(137)] 
    [ RESPONSE - OnRequest ]
    > Url: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&paymentId=c2782fd5-67ca-44cd-ae35-9eafbd7dd0e9&platform=android
    > Result: Success
    > HTTP Code: 200
    > Body: {"promotions":[{"id":"962abffd-4952-40cd-b90d-05868e233828","createdAt":"2022-04-12T16:02:19.900576Z","expiresAt":"2022-07-12T16:02:19.900576Z","version":5,"suggestionsPerGrant":120,"approximateValue":"30","type":"ugp","available":true,"platform":"android","publicKeys":["EuFcLm2oFoF1g6QGgozCcYkmslWy6eap+lXuD8XuGEw="],"legacyClaimed":false,"claimableUntil":"2022-07-12T16:02:19.900576Z"},{"id":"f5a6edde-6ca4-4f82-99d2-9b337f0c6cf0","createdAt":"2022-06-15T09:51:03.679403Z","expiresAt":"2022-10-15T09:51:03.679403Z","version":5,"suggestionsPerGrant":8,"approximateValue":"2","type":"ads","available":true,"platform":"android","publicKeys":["Lt+INaXeZXuPluVBkcYwUmXOH2A9nJRnrx3tX69/LVc="],"legacyClaimed":false,"claimableUntil":"2022-09-15T09:51:03.679403Z"}]}
2022-06-15 15:22:15.189 16505-16505/? V/chromium: [VERBOSE6:logging_util.cc(137)] 
    [ RESPONSE - OnRequest ]
    > Url: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
    > Result: Success
    > HTTP Code: 200
    > Body: {"drainId":"1d98f05c-ebed-4329-bfd3-b410ff18a1db"}
2022-06-15 15:22:15.197 16505-16505/? V/chromium: [VERBOSE6:logging_util.cc(137)] 
    [ RESPONSE - OnRequest ]
    > Url: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
    > Result: Success
    > HTTP Code: 200
    > Body: {"drainId":"18d2d8fe-e38f-479d-a34b-4615270f359c"}

Console logs for balance update

 [ REQUEST ]
    > URL: https://api.sandbox.gemini.com/v1/balances
    > Method: POST
2022-06-15 15:28:46.046 16505-16505/? V/chromium: [VERBOSE6:logging_util.cc(137)] 
    [ RESPONSE - OnRequest ]
    > Url: https://api.sandbox.gemini.com/v1/balances
    > Result: Success
    > HTTP Code: 200
    > Body: [{"type":"exchange","currency":"LTC","amount":"20000","available":"20000","availableForWithdrawal":"20000"},{"type":"exchange","currency":"BCH","amount":"20000","available":"20000","availableForWithdrawal":"20000"},{"type":"exchange","currency":"ETH","amount":"20000","available":"20000","availableForWithdrawal":"20000"},{"type":"exchange","currency":"ZEC","amount":"20000","available":"20000","availableForWithdrawal":"20000"},{"type":"exchange","currency":"USD","amount":"100000.00","available":"100000.00","availableForWithdrawal":"100000.00"},{"type":"exchange","currency":"BTC","amount":"1000","available":"1000","availableForWithdrawal":"1000"},{"type":"exchange","currency":"BAT","amount":"1476.45","available":"1476.45","availableForWithdrawal":"1476.45"}]

Case 3: bitFlyer_Verify that browser submits the vBAT to the custodian wallets when the user is in logged out state_PASSED
  • Clean profile 1.40.x
  • Enable rewards and connect the existing KYC'd bitFlyer wallet and note down the wallet balance
  • Get wallet into a logged out state
  • Confirm that the wallet is in the Logged out state
  • Send vBAT ad grants to the browser wallet id
  • Claim the vBAT ad grants and ensure claimed ad grants is shown in the wallet balance
  • Reload the brave://rewards page
  • Confirm that claimed vBAT is removed from the wallet balance
  • Connect to bitFlyer the account again
  • Confirmed that claimed vBAT is moved to bitFlyer wallet and balance is shown in the wallet
  • Confirmed that vBAT user drain logs are shown in the console
bitFlyer initial balance Logged Out Sent vBAT Claim vBAT Before page reload After page reload bitFlyer final balance
Screenshot_20220615-155320_Brave - Beta Screenshot_20220615-160554_Brave - Beta Screenshot_20220615-161619_Brave - Beta Screenshot_20220615-161717_Brave - Beta Screenshot_20220615-161741_Brave - Beta Screenshot_20220615-161817_Brave - Beta Screenshot_20220615-161903_Brave - Beta

Console logs for user drain

  [ REQUEST ]
    > URL: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
    > Method: POST
    > Content: {"credentials":[{"publicKey":"JE40zf..."}
    > Content Type: application/json; charset=utf-8
    > Header digest: SHA-256=xmpP9N2JZbhfhxEUYLX9GaYcrmegt5JoyTSLbyPpVEo=
    > Header signature: keyId="1ab6c0ab-632c-459a-a9ff-64df26564da6",algorithm="ed25519",headers="digest (request-target)",signature="AVyrKXxBsV2Ks0VTarmRX+7ycaXVNAU1WfgsBq2gmjXfhlvrZtkr2chAOTBHRjRm8q/4hd+JXScw8k30BfGaAg=="
    > Header accept: application/json
2022-06-15 16:18:11.374 28039-28039/? V/chromium: [VERBOSE6:logging_util.cc(137)] 
    [ RESPONSE - OnRequest ]
    > Url: https://grant.rewards.bravesoftware.com/v1/promotions?migrate=true&paymentId=1ab6c0ab-632c-459a-a9ff-64df26564da6&platform=android
    > Result: Success
    > HTTP Code: 200
    > Body: {"promotions":[{"id":"962abffd-4952-40cd-b90d-05868e233828","createdAt":"2022-04-12T16:02:19.900576Z","expiresAt":"2022-07-12T16:02:19.900576Z","version":5,"suggestionsPerGrant":120,"approximateValue":"30","type":"ugp","available":true,"platform":"android","publicKeys":["EuFcLm2oFoF1g6QGgozCcYkmslWy6eap+lXuD8XuGEw="],"legacyClaimed":false,"claimableUntil":"2022-07-12T16:02:19.900576Z"},{"id":"fe0b69fa-2b19-4a61-a732-e0a0c9c7f921","createdAt":"2022-06-15T10:40:49.247101Z","expiresAt":"2022-10-15T10:40:49.247101Z","version":5,"suggestionsPerGrant":8,"approximateValue":"2","type":"ads","available":true,"platform":"android","publicKeys":["JE40zfBftbBXtPWSdmKXJQbAL1VWtp6MS+xOCT5DIAw="],"legacyClaimed":false,"claimableUntil":"2022-09-15T10:40:49.247101Z"}]}
2022-06-15 16:18:11.670 28039-28039/? V/chromium: [VERBOSE1:conversions.cc(223)] URL is not supported for conversions
2022-06-15 16:18:11.670 28039-28039/? V/chromium: [VERBOSE1:ads_impl.cc(207)] Visited URL is not supported
2022-06-15 16:18:12.986 28039-28039/? V/chromium: [VERBOSE6:logging_util.cc(137)] 
    [ RESPONSE - OnRequest ]
    > Url: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
    > Result: Success
    > HTTP Code: 200
    > Body: {"drainId":"2c4526a9-d41f-4210-98e8-8a547bc5daff"}
2022-06-15 16:18:13.005 28039-28039/? V/chromium: [VERBOSE6:logging_util.cc(137)] 
    [ RESPONSE - OnRequest ]
    > Url: https://grant.rewards.bravesoftware.com/v2/suggestions/claim
    > Result: Success
    > HTTP Code: 200
    > Body: {"drainId":"a7bc082a-64be-4a05-ab21-6fe013682218"}

Console logs for balance update

 [ REQUEST ]
    > URL: https://demo24kiuw4dcyncsy3qlud8u8.azurewebsites.net/api/link/v1/account/inventory
    > Method: GET
2022-06-15 16:18:58.128 28039-28039/? V/chromium: [VERBOSE1:ads_impl.cc(177)] HTML content has not changed
2022-06-15 16:18:58.128 28039-28039/? V/chromium: [VERBOSE1:ads_impl.cc(199)] Text content has not changed
2022-06-15 16:18:58.233 28039-28039/? V/chromium: [VERBOSE6:logging_util.cc(137)] 
    [ RESPONSE - OnRequest ]
    > Url: https://demo24kiuw4dcyncsy3qlud8u8.azurewebsites.net/api/link/v1/account/inventory
    > Result: Success
    > HTTP Code: 200
    > Body: {
      "account_hash": "7e25dfa49c1a798591cad4a85511834135468a9c",
      "inventory": [
        
        {
          "currency_code": "BAT",
          "amount": 118.35,
          "available": 118.350000000000
        },

Additional checks

  • Confirmed users can send a one-time tip/recurring tip using the user drained vBAT via Uphold/Gemini/bitFlyer custodians
  • Confirmed users can perform the auto-contribution using vBAT via Uphold custodian
Uphold Gemini bitFlyer
Screenshot_20220715-201606_Brave - Beta Screenshot_20220715-170551_Brave - Beta Screenshot_20220715-163431_Brave - Beta

@Uni-verse Uni-verse added QA/In-Progress Indicates that QA is currently in progress for that particular issue and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/rewards OS/Android Fixes related to Android browser functionality OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass - Android Tab QA Pass-Win64 QA/Test-Plan-Specified QA/Yes release-notes/exclude
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants