Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Bump jsonrpsee from 0.20.3 to 0.21.0 #149

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 24, 2024

Bumps jsonrpsee from 0.20.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

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually 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)

@dependabot dependabot bot added Bot Bot Dep Dependency labels Jan 24, 2024
@dependabot dependabot bot force-pushed the dependabot/cargo/jsonrpsee-0.21.0 branch 2 times, most recently from 5c49a82 to d91ed7e Compare January 24, 2024 02:37
Bumps [jsonrpsee](https://github.com/paritytech/jsonrpsee) from 0.20.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.20.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 d91ed7e to 8184845 Compare January 24, 2024 02:40
Copy link
Contributor Author

dependabot bot commented on behalf of github Feb 8, 2024

Superseded by #159.

@dependabot dependabot bot closed this Feb 8, 2024
@dependabot dependabot bot deleted the dependabot/cargo/jsonrpsee-0.21.0 branch February 8, 2024 01:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bot Bot Dep Dependency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants