-
Notifications
You must be signed in to change notification settings - Fork 973
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12154 +/- ##
==========================================
- Coverage 55% 54.99% -0.01%
==========================================
Files 275 275
Lines 26569 26563 -6
Branches 4273 4277 +4
==========================================
- Hits 14613 14608 -5
+ Misses 11956 11955 -1
|
02fd0e6
to
5d306aa
Compare
const bat = ledgerState.getInfoProp(state, 'bat') | ||
return bat && (balance + unconfirmed > 0.9 * Number(bat)) | ||
const budget = parseInt(getSetting(settings.PAYMENTS_CONTRIBUTION_AMOUNT), 10) || 25 | ||
return balance + unconfirmed >= budget |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prior code that does getInfoProp(state, 'bat')
... but I'm not seeing anything which sets this. I think the field name must have been updated from bat
to converted
at some point.
Why this is important: because ledgerUtil does something similar (in fact, maybe this code can be moved to ledgerUtil?):
browser-laptop/app/common/lib/ledgerUtil.js
Lines 99 to 101 in 5677468
if (pendingFunds + Number(ledgerData.get('balance') || 0) < | |
0.9 * Number(ledgerData.get('bat') || 0)) { | |
status.id = 'insufficientFundsStatus' |
The code in ledgerUtil may have a problem too if nothing is setting this value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to fix this line as well, we don't have bat
anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NejcZdovc OK great- did you want to do that here also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah will fix it in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, @bsclifton please re-review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment left - tests all look good; just want to make sure similar code in ledgerUtil is handled the same
5d306aa
to
10f4d8d
Compare
Resolves brave#12078 Auditors: Test Plan:
…le testing) Manually tested (and updated test plan in PR). Works great! :) Auditors: @NejcZdovc
10f4d8d
to
c1ea5ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the 2nd case! I just finished manually testing and it works great 😄 👍
Please note: I did bump the version of bat-client
so that we can use the new LEDGER_NO_FUZZING
parameter for testing.
Works on Windows. No |
Submitter Checklist:
git rebase -i
to squash commits (if needed).Resolves #12078
Auditors:
also added unit test for it
Test Plan:
steps based on comment: #12078 (comment)
reconcileStamp
inledger-state.json
to the epoch for now (or a time in the past). (This site is handy for conversions)Reviewer Checklist:
Tests