-
Notifications
You must be signed in to change notification settings - Fork 895
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
Added notifications for Confirmed, Error and Dropped status changes #13330
Conversation
0636bb1
to
e8dd2ee
Compare
ca21ac7
to
c740887
Compare
393d7a0
to
7654dfc
Compare
@@ -36,7 +38,6 @@ source_set("brave_wallet") { | |||
"//services/network/public/cpp", | |||
"//third_party/abseil-cpp:absl", | |||
] | |||
|
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.
Please remove this unrelated change.
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.
done
@@ -14,7 +14,7 @@ | |||
|
|||
namespace { | |||
|
|||
base::OnceCallback<void()> g_NewSetupNeededForTestingCallback; | |||
absl::optional<bool> g_NewSetupNeededForTesting; |
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.
What's the reason of not just using boolean 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.
there is condition of existance on 39th line, replaced by optional to keep same logic
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 unnecessary, I think a boolean value initialized as false and just check the boolean value is what we needed.
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 variable name also needs to be underscore
browser/sources.gni
Outdated
@@ -102,8 +103,8 @@ brave_chrome_browser_deps = [ | |||
"//brave/browser:browser_process", | |||
"//brave/browser/brave_federated", | |||
"//brave/browser/brave_wallet", | |||
"//brave/browser/brave_wallet", |
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.
duplicate entry
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.
done
test/BUILD.gn
Outdated
@@ -88,6 +88,7 @@ test("brave_unit_tests") { | |||
"../../components/domain_reliability/test_util.h", | |||
"//brave/browser/brave_content_browser_client_unittest.cc", | |||
"//brave/browser/brave_resources_util_unittest.cc", | |||
"//brave/browser/brave_wallet/wallet_notification_service_unittest.cc", |
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.
Any reasons that it has to be added to this target instead of some wallet test target? In general we don't want to add to this huge target seems it's hard to manage.
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 couldn't find any mention of unittests in underlaying sources.gni
files, seems this is only way now to add test for this on UI level
explicit WalletNotificationService(content::BrowserContext* context, | ||
TxService* tx_state_manager); |
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.
s/tx_state_manager/tx_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.
done
content::BrowserContext* context, | ||
TxService* tx_service) | ||
: tx_service_(tx_service), context_(context) { | ||
tx_service_->AddObserver(tx_observer_receiver_.BindNewPipeAndPassRemote()); |
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 raw_ptr doesn't seem to be needed to be stored if all we need is the AddObserver call 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.
done
#include "mojo/public/cpp/bindings/pending_remote.h" | ||
#include "mojo/public/cpp/bindings/remote.h" |
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 two seems not needed in this header file, and the include for mojo::Receiver is missing.
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.
done
brave_wallet::WalletNotificationServiceFactory::GetServiceForContext( | ||
web_contents->GetBrowserContext()); |
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'm a bit confused about this. Could you explain what's this for? Triggering service creation? How is it related to the tab helper?
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.
yes, this is only to trigger service creation, it needs to be done on UI level for browser context
59e6ff2
to
acab33c
Compare
3e836ff
to
414a2c2
Compare
namespace brave_wallet { | ||
|
||
WalletNotificationService::WalletNotificationService( | ||
content::BrowserContext* context, |
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 not pass in the BrowserContext, pass in NotificationDisplayService from WalletNotificationServiceFactory
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 need BrowserContext inside WalletNotificationService
browser/brave_wallet/sources.gni
Outdated
# License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
# You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
brave_browser_brave_wallet_sources = [ |
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.
so based on dm discussion brave_wallet_tab_helper shouldn't need to be in sources.gni anymore so I would move it back to BUILD.gn and then create a subdir for notifications so we don't have sources.gni and BUILD.gn in the same directory
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.
done
adb4682
to
6440f59
Compare
test/BUILD.gn
Outdated
@@ -312,6 +313,7 @@ test("brave_unit_tests") { | |||
sources += [ | |||
"../utility/importer/chrome_importer_unittest.cc", | |||
"//brave/app/brave_command_line_helper_unittest.cc", | |||
"//brave/browser/brave_wallet/notifications/wallet_notification_service_unittest.cc", |
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 should not be added to this huge target, should be added to a wallet test target.
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.
done
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.
LGTM
Resolves brave/brave-browser#19885
Added WalletNotificationService to show notifications about transactions on UI level.
demo.mp4
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: