Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Contribution amounts were not updated during BTC => BAT conversion #11719

Closed
bsclifton opened this issue Oct 30, 2017 · 2 comments · Fixed by #11722
Closed

Contribution amounts were not updated during BTC => BAT conversion #11719

bsclifton opened this issue Oct 30, 2017 · 2 comments · Fixed by #11722

Comments

@bsclifton
Copy link
Member

bsclifton commented Oct 30, 2017

Test plan

#11722 (comment)


Description

Before BAT Mercury was released (0.19.x), there were a few contribution amounts you could pick:
$5, $10, $15, $20 (USD)

After BAT Mercury, users could choose:
25, 50, 75, 100 (BAT)

However, the amounts were never converted.

Steps to Reproduce

  1. Use an older version of Brave (0.18.36 for example)
  2. Enable payments and set contribution amount as one of the original amounts (like $10 for example)
  3. Upgrade to latest Brave
  4. In preferences#payments, you should notice it say 25 BAT
  5. Open the ledger-state.json file and inspect, looking for the properties section:
{
  "properties": {
    "setting": "adFree",
    "fee": {
      "currency": "BAT",
      "amount": 10
    },
    // other data...
  },
  // other data...

Actual result:
Value is kept as 10

Expected result:
Value should be converted to equivalent:
5 USD => 25 BAT
10 USD => 50 BAT
15 USD => 75 BAT
20 USD => 100 BAT

Reproduces how often: [What percentage of the time does it reproduce?]

Brave Version

about:brave info:

Brave: 0.19.70
rev: d4b94c6
Muon: 4.5.9
libchromiumcontent: 62.0.3202.62
V8: 6.2.414.32
Node.js: 7.9.0
Update Channel: Release
OS Platform: macOS
OS Release: 16.7.0
OS Architecture: x64

Reproducible on current live release:
yes

Additional Information

Here's a screenshot showing that payment for 10 BAT was processed (and you can see the UI shows 25 BAT as my selection)
image

@srirambv
Copy link
Collaborator

srirambv commented Nov 1, 2017

Still seeing this on upgrade from 0.18.36 to 0.19.71
11719

@srirambv srirambv reopened this Nov 1, 2017
bsclifton added a commit that referenced this issue Nov 1, 2017
Properly fixes #11719

Also fixes a `ledgerClient is not defined` error I saw when testing (fix is to call clientPrep). This only impacted folks that quit and needed to reload from file.

Auditors: @bbondy, @evq
bsclifton added a commit that referenced this issue Nov 1, 2017
Properly fixes #11719

Also fixes a `ledgerClient is not defined` error I saw when testing (fix is to call clientPrep). This only impacted folks that quit and needed to reload from file.

Auditors: @bbondy, @evq
bsclifton added a commit that referenced this issue Nov 1, 2017
Properly fixes #11719

Also fixes a `ledgerClient is not defined` error I saw when testing (fix is to call clientPrep). This only impacted folks that quit and needed to reload from file.

Auditors: @bbondy, @evq
@bsclifton
Copy link
Member Author

master 13c479b
0.21.x 23e8c48
0.20.x 8377614
0.19.x 8a49077

syuan100 pushed a commit to syuan100/browser-laptop that referenced this issue Nov 9, 2017
…ting

Fixes brave#11719

Auditors: @NejcZdovc, @evq, @petemill

Test Plan:
- Use an older version of Brave (0.18.36 for example)
- Enable payments and set contribution amount as one of the original amounts (like $10 for example)
- Run a build with this fix in it
- In preferences#payments, you should notice it should be 25 BAT if USD was $5, 50 if $10, 75 if $15, 100 if $20
- Exit Brave
- Open the ledger-state.json file and inspect, looking for properties.fee.amount
- This should have the new value (25, 50, 75, or 100) not the old value (5, 10, 15, 20)
syuan100 pushed a commit to syuan100/browser-laptop that referenced this issue Nov 9, 2017
Properly fixes brave#11719

Also fixes a `ledgerClient is not defined` error I saw when testing (fix is to call clientPrep). This only impacted folks that quit and needed to reload from file.

Auditors: @bbondy, @evq
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.