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

replace network_handle instance with boxed api trait #9279

Closed
mattsse opened this issue Jul 3, 2024 · 1 comment · Fixed by #9367
Closed

replace network_handle instance with boxed api trait #9279

mattsse opened this issue Jul 3, 2024 · 1 comment · Fixed by #9367
Assignees
Labels
A-observability Related to tracing, metrics, logs and other observability tools C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Jul 3, 2024

Describe the feature

This currently requires an instance of networkhandle:

/// Connection to the network.
network: Option<NetworkHandle>,

which is only used to get the current number of connected peers

self.network.as_ref().map(|net| net.num_connected_peers()).unwrap_or_default()

which is called via the PeersInfo trait, we can simply use a box here to get rid of the handle instance

TODO

replace

/// Connection to the network.
network: Option<NetworkHandle>,

with Option<Box<dyn PeersInfo>>

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started A-observability Related to tracing, metrics, logs and other observability tools labels Jul 3, 2024
@nicosanc
Copy link

nicosanc commented Jul 3, 2024

I'd like to take on this task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-observability Related to tracing, metrics, logs and other observability tools C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants