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
Do not access Global
via service locator in MainWindowViewModel
c…
#3756
Do not access Global
via service locator in MainWindowViewModel
c…
#3756
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.
Very well done. Much cleaner!
We're going back and forth with this. I remember like 3 times this was flipped and flopped: we started out with statics, then @NicolasDorier added them to constructors instead, then @danwalmsley, @molnard and me removed these from the constructor. I don't mind any of the two approaches, it's just let's settle with a single one. I suggest @danwalmsley to have the final say. |
I removed every static in the hope of making unit tests where you could simulate several wasabi wallets at once via their view model. Those unit test PR never got merged. If there is a single static singleton, then interactions between several wasabi wallet can't be tested, thus defeating the whole purpose of the exercise. @danwalmsley reason to reintroduce singleton was meant to be temporary if I remember. |
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 is better than what we have.
Offline in meetings and discussions with @kiminuo @lontivero @molnard the direction we would like to go in is:
|
Interfaces or objects but yes.
Agree, statics can be allowed in some cases but only if make sense to use them. |
…lass