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

Update jsonrpsee requirement from 0.17.0 to 0.18.0 #1764

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 24, 2023

Updates the requirements on jsonrpsee to permit the latest version.

Release notes

Sourced from jsonrpsee's releases.

v0.18.0

[v0.18.0] - 2023-04-21

This is a breaking release that removes the CallError which was used to represent a JSON-RPC error object that could happen during JSON-RPC method call and one could assign application specific error code, message and data in a specific implementation.

Previously jsonrpsee provided CallError that could be converted to/from jsonrpsee::core::Error and in some scenarios the error code was automatically assigned by jsonrpsee. After jsonrpsee added support for custom error types the CallError doesn't provide any benefit because one has to implement Into<ErrorObjectOwned> on the error type anyway.

Thus, jsonrpsee::core::Error can't be used in the proc macro API anymore and the type alias RpcResult has been modified to Result<(), ErrorObjectOwned> instead.

Before it was possible to do:

#[derive(thiserror::Error)]
enum Error {
	A,
	B,
}
#[rpc(server, client)]
pub trait Rpc
{
#[method(name = "getKeys")]
async fn keys(&self) -> Result<String, jsonrpsee::core::Error> {
Err(jsonrpsee::core::Error::to_call_error(Error::A))
// or jsonrpsee::core::Error::Call(CallError::Custom(ErrorObject::owned(1, "a", None::<()>)))
}
}

After this change one has to do:

pub enum Error {
	A,
	B,
}
impl From<Error> for ErrorObjectOwned {
fn from(e: Error) -> Self {
match e {
Error::A => ErrorObject::owned(1, "a", None::<()>),
Error::B => ErrorObject::owned(2, "b", None::<()>),
}
}
</tr></table>

... (truncated)

Changelog

Sourced from jsonrpsee's changelog.

[v0.18.0] - 2023-04-21

This is a breaking release that removes the CallError which was used to represent a JSON-RPC error object that could happen during JSON-RPC method call and one could assign application specific error code, message and data in a specific implementation.

Previously jsonrpsee provided CallError that could be converted to/from jsonrpsee::core::Error and in some scenarios the error code was automatically assigned by jsonrpsee. After jsonrpsee added support for custom error types the CallError doesn't provide any benefit because one has to implement Into<ErrorObjectOwned> on the error type anyway.

Thus, jsonrpsee::core::Error can't be used in the proc macro API anymore and the type alias RpcResult has been modified to Result<(), ErrorObjectOwned> instead.

Before it was possible to do:

#[derive(thiserror::Error)]
enum Error {
	A,
	B,
}
#[rpc(server, client)]
pub trait Rpc
{
#[method(name = "getKeys")]
async fn keys(&self) -> Result<String, jsonrpsee::core::Error> {
Err(jsonrpsee::core::Error::to_call_error(Error::A))
// or jsonrpsee::core::Error::Call(CallError::Custom(ErrorObject::owned(1, "a", None::<()>)))
}
}

After this change one has to do:

pub enum Error {
	A,
	B,
}
impl From<Error> for ErrorObjectOwned {
fn from(e: Error) -> Self {
match e {
Error::A => ErrorObject::owned(1, "a", None::<()>),
Error::B => ErrorObject::owned(2, "b", None::<()>),
}
}
}
</tr></table>

... (truncated)

Commits

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 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)

Updates the requirements on [jsonrpsee](https://github.com/paritytech/jsonrpsee) to permit the latest version.
- [Release notes](https://github.com/paritytech/jsonrpsee/releases)
- [Changelog](https://github.com/paritytech/jsonrpsee/blob/master/CHANGELOG.md)
- [Commits](paritytech/jsonrpsee@v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: jsonrpsee
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Apr 24, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2023

Codecov Report

Merging #1764 (8909286) into master (860f2e9) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1764   +/-   ##
=======================================
  Coverage   52.08%   52.08%           
=======================================
  Files         207      207           
  Lines        6652     6652           
=======================================
  Hits         3465     3465           
  Misses       3187     3187           

see 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ascjones ascjones merged commit 4ad0b7e into master Apr 25, 2023
@ascjones ascjones deleted the dependabot/cargo/jsonrpsee-0.18.0 branch April 25, 2023 08:25
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.

2 participants