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

Bump jsonrpsee from 0.16.3 to 0.21.0 #11

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 13, 2023

Bumps jsonrpsee from 0.16.3 to 0.21.0.

Release notes

Sourced from jsonrpsee's releases.

v0.21.0

[v0.21.0] - 2023-12-13

This release contains big changes and let's go over the main ones:

JSON-RPC specific middleware

After getting plenty of feedback regarding a JSON-RPC specific middleware, this release introduces a composable "tower-like" middleware that applies per JSON-RPC method call. The new middleware also replaces the old RpcLogger which may break some use-cases, such as if JSON-RPC was made on a WebSocket or HTTP transport, but it's possible to implement that by using jsonrpsee as a tower service or the low-level server API.

An example how write such middleware:

#[derive(Clone)]
pub struct ModifyRequestIf<S>(S);
impl<'a, S> RpcServiceT<'a> for ModifyRequestIf<S>
where
S: Send + Sync + RpcServiceT<'a>,
{
type Future = S::Future;
fn call(&amp;self, mut req: Request&lt;'a&gt;) -&gt; Self::Future {
	// Example how to modify the params in the call.
	if req.method == &quot;say_hello&quot; {
		// It's a bit awkward to create new params in the request
		// but this shows how to do it.
		let raw_value = serde_json::value::to_raw_value(&quot;myparams&quot;).unwrap();
		req.params = Some(StdCow::Owned(raw_value));
	}
	// Re-direct all calls that isn't `say_hello` to `say_goodbye`
	else if req.method != &quot;say_hello&quot; {
		req.method = &quot;say_goodbye&quot;.into();
	}
self.0.call(req)

}

}
async fn run_server() {
// Construct our middleware and build the server.
let rpc_middleware = RpcServiceBuilder::new().layer_fn(|service| ModifyRequestIf(service));
let server = Server::builder().set_rpc_middleware(rpc_middleware).build("127.0.0.1:0").await.unwrap();
// Start the server.
let mut module = RpcModule::new(());
module.register_method(&quot;say_hello&quot;, |_, _| &quot;lo&quot;).unwrap();

</tr></table>

... (truncated)

Changelog

Sourced from jsonrpsee's changelog.

[v0.21.0] - 2023-12-13

This release contains big changes and let's go over the main ones:

JSON-RPC specific middleware

After getting plenty of feedback regarding a JSON-RPC specific middleware, this release introduces a composable "tower-like" middleware that applies per JSON-RPC method call. The new middleware also replaces the old RpcLogger which may break some use-cases, such as if JSON-RPC was made on a WebSocket or HTTP transport, but it's possible to implement that by using jsonrpsee as a tower service or the low-level server API.

An example how write such middleware:

#[derive(Clone)]
pub struct ModifyRequestIf<S>(S);
impl<'a, S> RpcServiceT<'a> for ModifyRequestIf<S>
where
S: Send + Sync + RpcServiceT<'a>,
{
type Future = S::Future;
fn call(&amp;self, mut req: Request&lt;'a&gt;) -&gt; Self::Future {
	// Example how to modify the params in the call.
	if req.method == &quot;say_hello&quot; {
		// It's a bit awkward to create new params in the request
		// but this shows how to do it.
		let raw_value = serde_json::value::to_raw_value(&quot;myparams&quot;).unwrap();
		req.params = Some(StdCow::Owned(raw_value));
	}
	// Re-direct all calls that isn't `say_hello` to `say_goodbye`
	else if req.method != &quot;say_hello&quot; {
		req.method = &quot;say_goodbye&quot;.into();
	}
self.0.call(req)

}

}
async fn run_server() {
// Construct our middleware and build the server.
let rpc_middleware = RpcServiceBuilder::new().layer_fn(|service| ModifyRequestIf(service));
let server = Server::builder().set_rpc_middleware(rpc_middleware).build("127.0.0.1:0").await.unwrap();
// Start the server.
let mut module = RpcModule::new(());
module.register_method(&quot;say_hello&quot;, |_, _| &quot;lo&quot;).unwrap();
module.register_method(&quot;say_goodbye&quot;, |_, _| &quot;goodbye&quot;).unwrap();

</tr></table>

... (truncated)

Commits
  • 66af1e7 fix nits in the CHANGELOG (#1265)
  • 8466e12 refactor: set tcp_nodelay == true by default and explicit APIs (#1263)
  • 073aa28 chore: release v0.21 (#1261)
  • eca4223 refactor(client): unify ws ping/pong API with the server (#1258)
  • c253b6c chore(deps): update tokio-rustls requirement from 0.24 to 0.25 (#1256)
  • ecb9c12 chore(deps): update gloo-net requirement from 0.4.0 to 0.5.0 (#1260)
  • 0ca84f9 refactor: split client and server errors (#1122)
  • 0a39c1a fix(host filtering): allow hosts with multiple ports (#1227)
  • 92cc790 fix: a few nits (#1254)
  • bb5780c refactor(ws client): impl tokio:{AsyncRead, AsyncWrite} for EitherStream (#1249)
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Dec 13, 2023
Copy link
Contributor Author

dependabot bot commented on behalf of github Dec 20, 2023

Dependabot can't parse your Cargo.toml. Because of this, Dependabot cannot update this pull request.

@dependabot dependabot bot force-pushed the dependabot/cargo/jsonrpsee-0.21.0 branch from b004131 to 196e30b Compare December 20, 2023 10:17
Bumps [jsonrpsee](https://github.com/paritytech/jsonrpsee) from 0.16.3 to 0.21.0.
- [Release notes](https://github.com/paritytech/jsonrpsee/releases)
- [Changelog](https://github.com/paritytech/jsonrpsee/blob/master/CHANGELOG.md)
- [Commits](paritytech/jsonrpsee@v0.16.3...v0.21.0)

---
updated-dependencies:
- dependency-name: jsonrpsee
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/cargo/jsonrpsee-0.21.0 branch from 196e30b to dc9b4bd Compare December 20, 2023 14:07
Copy link
Contributor Author

dependabot bot commented on behalf of github Feb 7, 2024

Superseded by #23.

@dependabot dependabot bot closed this Feb 7, 2024
@dependabot dependabot bot deleted the dependabot/cargo/jsonrpsee-0.21.0 branch February 7, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants