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

http client: add default backend type #1096

Closed
niklasad1 opened this issue Apr 25, 2023 · 0 comments · Fixed by #1099
Closed

http client: add default backend type #1096

niklasad1 opened this issue Apr 25, 2023 · 0 comments · Fixed by #1099
Assignees

Comments

@niklasad1
Copy link
Member

niklasad1 commented Apr 25, 2023

After we added tower middleware support for the HttpClient one has to do:

type HttpClient = jsonrpsee::http_client::HttpClient<jsonrpsee::http_client::transport::HttpBackend>;

struct MyWrapper(HttpClient);

It would be good if folks doesn't have to do that when the default backend is used i.e, not tower middleware enabled on the client.

Such as:

/// JSON-RPC HTTP Client that provides functionality to perform method calls and notifications.
#[derive(Debug, Clone)]
pub struct HttpClient<S = HttpBackend> {
	/// HTTP transport client.
	transport: HttpTransportClient<S>,
	/// Request timeout. Defaults to 60sec.
	request_timeout: Duration,
	/// Request ID manager.
	id_manager: Arc<RequestIdManager>,
}

Code to change/fix https://github.com/paritytech/jsonrpsee/blob/master/client/http-client/src/client.rs#L236-#L245

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 a pull request may close this issue.

2 participants