-
Notifications
You must be signed in to change notification settings - Fork 873
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
chore(wallet): Migrate Report Tx Sent P3A question into core #22360
Conversation
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
…ation, unit test network P3A switch.
7c84fb1
to
717dc64
Compare
A Storybook has been deployed to preview UI for the latest push |
717dc64
to
f099e07
Compare
f099e07
to
8b7cb6a
Compare
A Storybook has been deployed to preview UI for the latest push |
} | ||
auto tx_coin = GetCoinTypeFromTxDataUnion(*tx_info->tx_data_union); | ||
if (tx_coin == mojom::CoinType::BTC || tx_coin == mojom::CoinType::ZEC) { | ||
// BTC, ZEV transactions are not tracked yet |
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.
nit: ZEC
@@ -1967,7 +1977,8 @@ TEST_F(KeyringServiceUnitTest, RestoreLegacyBraveWallet) { | |||
KeyringService service(json_rpc_service(), GetPrefs(), GetLocalState()); | |||
BraveWalletService brave_wallet_service( | |||
shared_url_loader_factory(), nullptr, &service, json_rpc_service(), | |||
nullptr, nullptr, nullptr, GetPrefs(), GetLocalState(), false); | |||
tx_service(&service).get(), nullptr, nullptr, GetPrefs(), GetLocalState(), |
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 creates unique_ptr<TxService>
and immediately destroys it leaving danglig pointer in brave_wallet_service.tx_service_
-- most likely will crash in ASAN builds. It should be either TxService living on stack like KeyringService service
above or allowing tx_service to be null for tests(see CHECK_IS_TEST()
)
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.
TIL about CHECK_IS_TEST
👍 . I went with MakeTxService
route given check_is_test.h documentation.
@@ -170,6 +171,15 @@ class KeyringServiceUnitTest : public testing::Test { | |||
|
|||
JsonRpcService* json_rpc_service() { return json_rpc_service_; } | |||
|
|||
std::unique_ptr<TxService> tx_service(KeyringService* service) { |
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.
tx_service()
naming style is for trivial getters only. For this case it should be like MakeTxService(...)
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_; | ||
network::TestURLLoaderFactory url_loader_factory_; | ||
data_decoder::test::InProcessDataDecoder in_process_data_decoder_; | ||
std::string tx_hash1_; |
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.
It seems we don't need tx_hash1_
being a field
…ervice` to avoid dangling pointer & cleanup.
A Storybook has been deployed to preview UI for the latest push |
@@ -590,7 +589,7 @@ TEST_F(BraveWalletP3AUnitTest, SolTransactionSentObservation) { | |||
mojom::TxDataUnion::NewSolanaTxData(std::move(solana_tx_data)), | |||
mojom::kSolanaMainnet, sol_from(), &tx_meta_id)); | |||
|
|||
tx_hash1_ = | |||
std::string tx_hash1_ = |
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.
Nit: local variables should not have trailing underscore
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.
Wallet core lgtm.
Please uplift to 1.64 and 1.65
A Storybook has been deployed to preview UI for the latest push |
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.
Just unblocking for wallet-core since @supermassive already approved.
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.
Wallet Desktop Frontend ++
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.
👍 Android code looks good!
Thank you for the fix.
* Move P3A transaction sent reporting into core
Verification PASSED on
EthAccounts Case 1: Brave.Wallet.EthTransactionSent = 0_PASSEDCase 1.1: No Eth TransactionSent
Case 1.2: Eth transactions sent exceeded 7 days_PASSED
Case 2: Brave.Wallet.EthTransactionSent = 1_PASSEDCase 2.1: Eth TransactionSent
Case 2.2: Eth Transaction Sent in past 7 days_PASSED
Solana accounts: Case 1: Brave.Wallet.SolTransactionSent = 0_PASSEDCase 1.1: No Sol TransactionSent
Case 1.2: Sol transactions sent exceeded 7 days_PASSED
Case 2: Brave.Wallet.SolTransactionSent = 1_PASSEDCase 2.1: Sol TransactionSent
Case 2.2: Sol Transaction Sent in past 7 days_PASSED
FilecoinAccounts Case 1: Brave.Wallet.FilTransactionSent = 0_PASSEDCase 1.1: No Fil TransactionSent
Case 1.2: Sol transactions sent exceeded 7 days_PASSED
Case 2: Brave.Wallet.FilTransactionSent = 1_PASSEDCase 2.1: Fil TransactionSent
Case 2.2: Sol Transaction Sent in past 7 days_PASSED
Verification PASSED on
Note: Filecoin is NOT implemented for Android, confirmed with wallet QA spoc @srirambv. Hence not verified Filecoin accounts verification on Android EthAccounts Note: Step 2, 3 are not required on Android as Test nework is enabled by default when brave is launched using Case 1: Brave.Wallet.EthTransactionSent = 0_PASSEDCase 1.1: No Eth TransactionSent
Case 1.2: Eth transactions sent exceeded 7 days_PASSED
Case 2: Brave.Wallet.EthTransactionSent = 1_PASSEDCase 2.1: Eth TransactionSent
Case 2.2: Eth Transaction Sent in past 7 days_PASSED
Solana accounts: Note: Step 2 is not required on Android as Test nework is enabled by default when brave is launched using Case 1: Brave.Wallet.SolTransactionSent = 0_PASSEDCase 1.1: No Sol TransactionSent
Case 1.2: Sol transactions sent exceeded 7 days_PASSED
Case 2: Brave.Wallet.SolTransactionSent = 1_PASSEDCase 2.1: Sol TransactionSent
Case 2.2: Sol Transaction Sent in past 7 days_PASSED
|
Resolves brave/brave-browser#36156
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
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Desktop/Android:
--p3a-count-wallet-test-networks
flag. Ensure profile contains wallet with testnet tokens.iOS:
Brave Wallet Count Test Networks
Brave Core Switch enabled. Ensure profile contains wallet with testnet tokens.Brave Wallet Count Test Networks
. You will have to quit the app and restart for changes to take effect....
->Settings
->View Chromium Local State
...
and tapWallet Settings
->Networks
-> enableShow Test Networks
switch.