-
Notifications
You must be signed in to change notification settings - Fork 888
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
Calculate account statement from locally persisted state #10956
Conversation
e0e4309
to
1422fb8
Compare
b35703b
to
6c14779
Compare
6c14779
to
ee9eabc
Compare
5f5b319
to
841f8d6
Compare
build/rust/Cargo.lock
Outdated
@@ -1055,9 +1055,9 @@ dependencies = [ | |||
|
|||
[[package]] |
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.
Do we need to commit changes in this file?
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
@@ -66,19 +66,19 @@ void Account::RemoveObserver(AccountObserver* observer) { | |||
} | |||
|
|||
bool Account::SetWallet(const std::string& id, const std::string& seed) { | |||
const WalletInfo last_wallet = wallet_->Get(); | |||
const WalletInfo& last_wallet = wallet_->Get(); |
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.
In this case adding a reference &
dosn't do any optimizations because wallet_->Get() returns a copy of WalletInfo object.
I think const WalletInfo last_wallet = wallet_->Get();
is better here.
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.
Agreed to followup in a separate issue
void Account::TopUpUnblindedTokens() { | ||
if (!ShouldRewardUser()) { | ||
return; | ||
} | ||
|
||
const WalletInfo wallet = GetWallet(); | ||
const WalletInfo& wallet = GetWallet(); |
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.
seems like const WalletInfo wallet = GetWallet();
would be better and in the code below.
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.
Agreed to followup in a separate issue
namespace ads { | ||
|
||
base::Time GetNextPaymentDate(const TransactionList& transactions) { | ||
const base::Time& next_token_redemption_at = base::Time::FromDoubleT( |
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.
These references are also redundant. Agreed to followup in a separate issue
7c7d414
to
18410e9
Compare
Resolves brave/brave-browser#16028
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
confirmations.json
when a user resets Rewardsconfirmations.json
when a user resets Rewardsdatabase.sqlite
when a user resets Rewardstransactions
are migrated fromconfirmations.json
to a newtransactions
table indatabase.sqlite
(built from a list of transactions for this month, a single transaction for unredeemed transactions for previous months and a single transaction for redeemed transactions last month)transactions
table indatabase.sqlite
redeemed_at
column for the 'transactions' table indatabase.sqlite
is updated for cashed-out tokensnext_token_redemption_date_in_seconds
is migrated fromconfirmations.json
tobrave.brave_ads.rewards.next_time_redemption_at
preftransaction
tables that have a large amount of transactions (especially on iOS)NOTE:
GET /v1/confirmation/payment/{payment_id}
endpoint has been deprecated