Add unchecked constructors for FuelClient#3183
Conversation
PR SummaryMedium Risk Overview Call sites and tests are updated accordingly: e2e tests normalize endpoints explicitly before calling Written by Cursor Bugbot for commit 9f40c05. This will update automatically on new commits. Configure here. |
crates/client/src/client.rs
Outdated
| } | ||
|
|
||
| #[cfg(feature = "rpc")] | ||
| pub async fn new_unchecked_with_rpc<G: AsRef<str>, R: AsRef<str>>( |
There was a problem hiding this comment.
new_with_rpc is not released, you can make this function automatically not affect the URL
There was a problem hiding this comment.
I considered that but felt like it was inconsistent. I can change it though.
There was a problem hiding this comment.
Let's remove this function, we have new_with_rpc which is enough
crates/client/src/client.rs
Outdated
| Self::from_str(url.as_ref()) | ||
| } | ||
|
|
||
| pub fn new_unchecked(url: impl AsRef<str>) -> anyhow::Result<Self> { |
There was a problem hiding this comment.
Just deprecate the new method, we want people to start to use the new constructors with multiple URLs.
There was a problem hiding this comment.
I meant we don't need new_unchecked anymore. we have method that accepts multiple endpoints
| Ok(client) | ||
| } | ||
|
|
||
| pub fn with_urls(urls: &[impl AsRef<str>]) -> anyhow::Result<Self> { |
There was a problem hiding this comment.
This function is only used by us, so we can also alter its behaviour and do not do normalization.
xgreenx
left a comment
There was a problem hiding this comment.
I still we want to do at least instead of just Url::parse
if !raw_url.starts_with("http") {
raw_url = format!("http://{raw_url}");
}
| use tempfile::TempDir; | ||
| // Used for writing assertions // Run programs |
There was a problem hiding this comment.
| use tempfile::TempDir; | |
| // Used for writing assertions // Run programs | |
| use tempfile::TempDir; |
crates/client/src/client.rs
Outdated
| Self::from_str(url.as_ref()) | ||
| } | ||
|
|
||
| pub fn new_unchecked(url: impl AsRef<str>) -> anyhow::Result<Self> { |
There was a problem hiding this comment.
I meant we don't need new_unchecked anymore. we have method that accepts multiple endpoints
crates/client/src/client.rs
Outdated
| } | ||
|
|
||
| #[cfg(feature = "rpc")] | ||
| pub async fn new_unchecked_with_rpc<G: AsRef<str>, R: AsRef<str>>( |
There was a problem hiding this comment.
Let's remove this function, we have new_with_rpc which is enough
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Linked Issues/PRs
Closes #3176
Description
Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]