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.20.3 to 0.21.0 in /deepwell #1763

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 1, 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 requested a review from emmiegit as a code owner January 1, 2024 06:27
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Jan 1, 2024
@emmiegit
Copy link
Member

emmiegit commented Jan 8, 2024

@dependabot rebase

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/deepwell/jsonrpsee-0.21.0 branch from 5bf82ca to e292f20 Compare January 8, 2024 07:10
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2abf6da) 39.49% compared to head (e292f20) 39.49%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1763   +/-   ##
========================================
  Coverage    39.49%   39.49%           
========================================
  Files          342      342           
  Lines        10983    10983           
========================================
  Hits          4338     4338           
  Misses        6645     6645           
Flag Coverage Δ *Carryforward flag
deepwell 2.01% <ø> (ø)
ftml 76.69% <ø> (ø) Carriedforward from 2abf6da

*This pull request uses carry forward flags. Click here to find out more.

@emmiegit emmiegit merged commit 5fc6edc into develop Jan 8, 2024
9 checks passed
@emmiegit emmiegit deleted the dependabot/cargo/deepwell/jsonrpsee-0.21.0 branch January 8, 2024 07: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.

1 participant