-
Notifications
You must be signed in to change notification settings - Fork 892
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 semi-verified state #9032
Remove semi-verified state #9032
Conversation
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.
Looks good! I'll build this branch and give it a run-through tomorrow.
vendor/bat-native-ledger/src/bat/ledger/internal/wallet/wallet.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization.h
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization.cc
Outdated
Show resolved
Hide resolved
088ad1c
to
dc5a50a
Compare
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization.h
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization_unittest.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization_unittest.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_wallet.h
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization_unittest.cc
Outdated
Show resolved
Hide resolved
c578f2b
to
e7a597b
Compare
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_authorization_unittest.cc
Outdated
Show resolved
Hide resolved
} | ||
|
||
if (wallet->payment_id.empty()) { | ||
BLOG(0, "Payment ID is empty!"); |
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.
Definitely not something we should address with this PR, but I'm curious (@zenparsing, @emerick, @szilardszaloki) if it would make sense to switch to using constants for the info levels?
brave-core/vendor/bat-native-ledger/src/bat/ledger/internal/logging/logging.h
Lines 45 to 53 in 5a4a600
// BAT Ledger verbose levels: | |
// | |
// 0 Error | |
// 1 Info | |
// 5 URL request | |
// 6 URL response | |
// 7 URL response (with large body) | |
// 8 Database queries | |
// 9 Detailed debugging (response headers, etc) |
We could address by making an enum
enum LedgerLogLevel {
Error,
Info,
UrlRequest = 5,
UrlResponse,
UrlResponseWithBody,
DbQueries
};
// ...
if (wallet->payment_id.empty()) {
BLOG(LedgerLogLevel::Error, "Payment ID is empty!");
// ...
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.
This would be a lot more informative.
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.
I definitely like that idea.
return "HappyPath"; | ||
} | ||
|
||
INSTANTIATE_TEST_SUITE_P( |
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.
Nice usage of parameterized tests! These are really cool 😄
For other reviewers, more info at https://source.chromium.org/chromium/chromium/src/+/main:third_party/googletest/src/googletest/include/gtest/gtest-param-test.h;l=71-93;drc=0a3a3a845e136a9a6ccd8e9b924b848840f22b7b
d29db64
to
002d5f3
Compare
Adding GetAnonFunds(), OnGetAnonFunds(), TransferAnonFunds() and OnTransferAnonFunds() to UpholdAuthorization.
By removing the call to WalletClaim::Start() in Wallet::ClaimFunds(), we avoid fetching the balances for all the wallet types (anonymous, blinded, uphold and bitflyer) and avoid linking the Uphold account to the Brave wallet in the "generate wallet flow". Fetching the balance of the anonymous wallet and the linking are already implemented in UpholdAuthorization::GetAnonFunds() and UpholdAuthorization::TransferAnonFunds(), respectively, in the "authorization flow".
It's cleared in the "authorization flow" to be able to tell if we need to do the linking in the "generate wallet flow". It's set in the "generate wallet flow" on successful linking or when the device limit is reached. Now that linking happens during authorization, we don't need it anymore.
… for UpholdAuthorization::GetAnonFunds().
Adding ledger::database::Database mocking to support the "brave_wallet_is_not_created" scenario.
…on::GetAnonFunds().
…dAuthorization::OnGetAnonFunds()), if the Brave wallet's payment_id is empty.
Removing Wallet::ClaimFunds() and performing the call to Promotion::TransferTokens() directly in uphold_wallet.cc. Renaming UpholdAuthorization::TransferAnonFunds() to UpholdAuthorization::LinkWallet().
Removing brave_rewards::prefs::kAnonTransferChecked. Making UpholdAuthorization::GetAnonFunds() and UpholdAuthorization::LinkWallet() private (using FRIEND_TEST_ALL_PREFIXES). Updating copyright year in uphold_authorization_unittest.cc. Adjusting TEST_P's and INSTANTIATE_TEST_SUITE_P's arguments in uphold_authorization_unittest.cc. Passing drain_id by reference-to-const in UpholdWallet::OnTransferTokens().
Removing #include "bat/ledger/option_keys.h" where applicable.
002d5f3
to
6e1301e
Compare
Closing as this should have been covered in #9212 cc: @szilardszaloki in case I missed something 😄 |
Do the linking of the Uphold account to the Brave wallet during authorization.
Added the balance fetching of the anonymous wallet to the Uphold
authorization
flow.Removed fetching the balances for all the wallet types (anonymous, blinded, uphold and bitflyer) and removed linking from the
generate wallet
flow.Resolves brave/brave-browser#15390.
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: