Skip to content
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 di singleton #1530

Merged
merged 5 commits into from
Mar 21, 2023
Merged

Remove di singleton #1530

merged 5 commits into from
Mar 21, 2023

Conversation

turuslan
Copy link
Contributor

Referenced issues

Description of the Change

  • disable di singleton with boost::di::extension::shared_config
  • remove static from bind_by_lambda
  • const std::shared_ptr<application::AppStateManager> & -> application::AppStateManager &
  • const AppConfiguration &config -> std::shared_ptr<AppConfiguration>
  • const std::shared_ptr<crypto::Sr25519Keypair> & -> std::shared_ptr<crypto::Sr25519Keypair>

Benefits

  • Supposedly reduces static destructor order problems

Possible Drawbacks

turuslan and others added 4 commits March 16, 2023 10:14
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: kamilsa <kamilsa16@gmail.com>
@turuslan turuslan enabled auto-merge (squash) March 21, 2023 10:56
Comment on lines +622 to 625
bind_by_lambda<runtime::RuntimeUpgradeTrackerImpl>(
[](auto const &injector) {
return get_runtime_upgrade_tracker(injector);
}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bind_by_lambda<runtime::RuntimeUpgradeTrackerImpl>(
[](auto const &injector) {
return get_runtime_upgrade_tracker(injector);
}),
bind_by_lambda<runtime::RuntimeUpgradeTrackerImpl>(get_runtime_upgrade_tracker),

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And for other such cases

@turuslan turuslan disabled auto-merge March 21, 2023 11:10
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan enabled auto-merge (squash) March 21, 2023 11:49
@turuslan turuslan merged commit 9b12fd3 into master Mar 21, 2023
@turuslan turuslan deleted the di/no-singleton branch March 21, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants