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

Remove balance api #9132

Closed
NejcZdovc opened this issue Apr 10, 2020 · 1 comment · Fixed by brave/brave-core#5737
Closed

Remove balance api #9132

NejcZdovc opened this issue Apr 10, 2020 · 1 comment · Fixed by brave/brave-core#5737

Comments

@NejcZdovc
Copy link
Contributor

NejcZdovc commented Apr 10, 2020

we should remove balance api for majority of users. Flow should be like this:

  • introduce migration flag (default = false)
  • if migration flag is false fetch from balance server
  • if user has any balance there (which is user funds) we should continue normally
  • if user don't have any balance set flag to true as user can't create new user funds anymore
  • if flag is set to true skip brave balance server ping

We need to force balance pull when user restores wallet. When user funds are gone we need to set flag to true so that we don't pull anymore.

@LaurenWags
Copy link
Member

LaurenWags commented Jun 26, 2020

Verified passed with

Brave | 1.11.78 Chromium: 83.0.4103.116 (Official Build) dev (64-bit)
-- | --
Revision | 8f0c18b4dca9b6699eb629be0f51810c24fb6428-refs/branch-heads/4103@{#716}
OS | macOS Version 10.14.6 (Build 18G3020)

Verified plan 1 from brave/brave-core#5737.

  • Confirmed no calls to https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance when opening panel or brave://rewards page
  • Confirmed after claiming grant balance is displayed as expected and still no calls to balance server when opening panel or brave://rewards page
  • Confirmed after restoring a user wallet (with non-zero balance), https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance was called. Confirmed thereafter additional calls to balance server were made when opening panel or brave://rewards page.
  • Confirmed after restoring a user wallet (with 0 BAT balance), https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance was called once where it returned the zero balance. Confirmed thereafter additional calls to balance server were not made when opening panel or brave://rewards page.

Verified plan 2 from brave/brave-core#5737.

  • Installed 1.10.97, enabled Rewards (staging env). Claimed UGP grant.
  • Upgraded to 1.11.x. Confirmed one call to https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance.
  • Confirmed opening panel and brave://rewards page did not invoke calls to the balance server.
  • Confirmed close/restart of browser did not invoke calls to the balance server.

Verified plan 3 from brave/brave-core#5737.

  • Installed 1.10.97, enabled Rewards (staging env). Restored an anon wallet with non-zero BAT balance.
  • Upgraded to 1.11.x. Confirmed call to https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance.
  • Confirmed opening panel and brave://rewards page did invoke calls to the balance server.
  • Confirmed close/restart of browser did invoke calls to the balance server.

Verification passed on


Brave | 1.11.84 Chromium: 83.0.4103.116 (Official Build) dev (64-bit)
-- | --
Revision | 8f0c18b4dca9b6699eb629be0f51810c24fb6428-refs/branch-heads/4103@{#716}
OS | Windows 10 OS Version 1903 (Build 18362.900)

  • Verified the test plan which mentioned above

Verified passed with

Brave	1.11.87 Chromium: 83.0.4103.116 (Official Build) dev (64-bit)
Revision	8f0c18b4dca9b6699eb629be0f51810c24fb6428-refs/branch-heads/4103@{#716}
OS	Linux

Verified plan 1 from brave/brave-core#5737.

  • Confirmed no calls to https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance when opening panel or brave://rewards page
  • Confirmed after claiming grant balance is displayed as expected and still no calls to balance server when opening panel or brave://rewards page
  • Confirmed after restoring a user wallet (with non-zero balance), https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance was called. Confirmed thereafter additional calls to balance server were made when opening panel or brave://rewards page.
  • Confirmed after restoring a user wallet (with 0 BAT balance), https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance was called once where it returned the zero balance. Confirmed thereafter additional calls to balance server were not made when opening panel or brave://rewards page.

Verified plan 2 from brave/brave-core#5737.

  • Installed 1.10.97, enabled Rewards (staging env). Claimed UGP grant.
  • Upgraded to 1.11.x. Confirmed one call to https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance.
  • Confirmed opening panel and brave://rewards page did not invoke calls to the balance server.

Verified plan 3 from brave/brave-core#5737.

  • Installed 1.10.97, enabled Rewards (staging env). Restored an anon wallet with non-zero BAT balance.
  • Upgraded to 1.11.x. Confirmed call to https://balance-staging.mercury.basicattentiontoken.org/v2/wallet/<paymentID>/balance.
  • Confirmed opening panel and brave://rewards page did invoke calls to the balance server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment