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

Mark tokens as spendable if contribution failes #5979

Merged
merged 1 commit into from
Jul 1, 2020
Merged

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Jun 30, 2020

Resolves brave/brave-browser#10522

Submitter Checklist:

Test Plan:

  • defined in the issue

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@NejcZdovc NejcZdovc added this to the 1.12.x - Nightly milestone Jun 30, 2020
@NejcZdovc NejcZdovc requested a review from a team June 30, 2020 18:05
@NejcZdovc NejcZdovc self-assigned this Jun 30, 2020
@NejcZdovc NejcZdovc requested review from emerick and zenparsing and removed request for a team June 30, 2020 18:06
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NejcZdovc
Copy link
Contributor Author

CI failed on test-install, all good

@LaurenWags
Copy link
Member

Verified using PR builder build (https://bravesoftware.slack.com/archives/CMH8DU4TF/p1593550207257100)

Scenario 1

  • Verified STR from issue
  • Confirmed able to tip 20 BAT in step 7 and tip looks successful:
[14614:775:0701/074810.055567:VERBOSE1:contribution.cc(399)] Creating contribution(blinded) for 0 type RewardsType::ONE_TIME_TIP
[14614:775:0701/074810.061567:VERBOSE1:contribution.cc(267)] Timer will start in 9
[14614:775:0701/074810.103554:VERBOSE5:ledger_impl.cc(471)] 
[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v1/suggestions
[ RESPONSE - OnRedeemTokens ]
> Url: https://grant.rewards.bravesoftware.com/v1/suggestions
> Result: Success

AC was stopped right after DDG so the other AC publishers have a contributed_amount of 0 and the 1 time tip is listed at the bottom:
Screen Shot 2020-07-01 at 7 51 49 AM

VG tokens were released from reserve process to be able to be used for the 1 time tip (first 5 tokens were for DDG AC, remaining used were used for the 1 time tip)
Screen Shot 2020-07-01 at 7 52 59 AM

  • Confirmed able to tip 1 BAT successfully as in step 8

Scenario 2 - same as 1 but use a restored anon wallet instead of UGP grant in step 2 (and I adjusted monthly budget to be 10 BAT instead of 20)

  • Confirmed able to tip 5 BAT in step 7 and tip looks successful:
[14781:775:0701/080829.143039:VERBOSE1:contribution.cc(399)] Creating contribution(anonymous) for 0 type RewardsType::ONE_TIME_TIP
[14781:775:0701/080829.148819:VERBOSE1:contribution.cc(267)] Timer will start in 6
[14781:775:0701/080829.149109:VERBOSE5:ledger_impl.cc(471)] 
[ REQUEST ]
> URL: http://payment.rewards.bravesoftware.com/v1/orders

AC was stopped right after first publisher so the other AC publishers have a contributed_amount of 0 and the 1 time tip is listed at the bottom:
Screen Shot 2020-07-01 at 8 13 46 AM

SKU tokens used for the tip are listed in unblinded_tokens but as discussed previously, tokens obtained for the auto contribute which were not used are still listed but not part of your balance/cannot be used (https://bravesoftware.slack.com/archives/CB0KCRCQN/p1593520104213200?thread_ts=1593519527.212600&cid=CB0KCRCQN)
Screen Shot 2020-07-01 at 8 14 30 AM
Screen Shot 2020-07-01 at 8 14 46 AM
Screen Shot 2020-07-01 at 8 15 00 AM

@NejcZdovc NejcZdovc merged commit e97aa51 into master Jul 1, 2020
@NejcZdovc NejcZdovc deleted the release-tokens branch July 1, 2020 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Desktop] tips do not work correctly after turning off AC to stop retries - follow up to 10257
4 participants