Skip to content

adds checks before attempting to connect broadcast providers #49

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

Conversation

dylanlott
Copy link
Contributor

@dylanlott dylanlott commented Jan 27, 2025

tl;dr

checks for empty string before attempting to create providers from the builder's tx_broadcast_urls configuration field.

- checks for empty string before attempting to connect to providers
in the tx_broadcast_urls configuration field
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dylanlott dylanlott self-assigned this Jan 27, 2025
@dylanlott dylanlott marked this pull request as ready for review January 27, 2025 20:53
let provider =
ProviderBuilder::new().on_builtin(url).await.map_err(Into::<ConfigError>::into)?;
providers.push(provider);
if !self.tx_broadcast_urls.is_empty() && self.tx_broadcast_urls[0] != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we just do this when we actually populate self.tx_broadcast_urls?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, that works too. I was thinking about the case where we wanted to do additional setup or validation with the URLs but this works.

@anna-carroll
Copy link
Contributor

closing in favor of #50

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.

2 participants