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 RPC interface to jsonrpsee-0.23.2 #5283

Merged
merged 2 commits into from
Sep 22, 2024

Conversation

syan095
Copy link
Contributor

@syan095 syan095 commented Sep 20, 2024

Updated our RPC interface in custom-rpc crate to jsonrpsee-0.23.2
Major changes to how subscriptions are streamed.
Major changes to all error types.

Major changes to how subscriptions are streamed.
Major changes to all error types.
Err(error) =>
anyhow::anyhow!("DispatchError: Unable to deserialize error message: '{error}'"),
fn to_rpc_error<E: std::error::Error + Send + Sync + 'static>(e: E) -> ErrorObjectOwned {
ErrorObject::owned(jsonrpsee::types::error::CALL_EXECUTION_FAILED_CODE, format!("{:?}", e), Option::<()>::None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ErrorObject::owned(jsonrpsee::types::error::CALL_EXECUTION_FAILED_CODE, format!("{:?}", e), Option::<()>::None)
str_to_rpc_error(format!("{}", e))

Comment on lines 932 to 935
ErrorObject::owned(
jsonrpsee::types::error::CALL_EXECUTION_FAILED_CODE,
match e {
DispatchErrorWithMessage::Module(message) => match std::str::from_utf8(&message) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ErrorObject::owned(
jsonrpsee::types::error::CALL_EXECUTION_FAILED_CODE,
match e {
DispatchErrorWithMessage::Module(message) => match std::str::from_utf8(&message) {
str_to_rpc_error(
match e {
DispatchErrorWithMessage::Module(message) => match std::str::from_utf8(&message) {
//...

@syan095 syan095 merged commit a68b76f into chore/update-polkadot-sdk-1.15.2 Sep 22, 2024
@syan095 syan095 deleted the chore/jsonrpsee-0.23.2 branch September 22, 2024 23:39
dandanlen pushed a commit that referenced this pull request Oct 7, 2024
* Migrated RPC interface to jsonrpsee-0.23.2
Major changes to how subscriptions are streamed.
Major changes to all error types.

* Improved how errors are converted to ErrorObjectOwned
github-merge-queue bot pushed a commit that referenced this pull request Oct 9, 2024
* Updated polkadotSDK version of 1.15.2
Updated Rust compile version to nightly-2024-06-01
Updated some other library to newer version
Cleaned up the std feature references.

WIP does not build due to feature conflict

* Wip: Updated jsonrpsee to 0.23.2

* Update RPC interface to jsonrpsee-0.23.2 (#5283)

* Migrated RPC interface to jsonrpsee-0.23.2
Major changes to how subscriptions are streamed.
Major changes to all error types.

* Improved how errors are converted to ErrorObjectOwned

* Migrated to Runtime V2 macro

* Worked through Clis

* Fixed cargo check

* Fixed build

* Fixed unit tests

* Bumped support to rust version 2024-07-01

* Upgraded to be compatible with version 2024-08-04

Updated documentations to be fix warning in later versions.

Cannot upgrade to further version because Substrate code triggers
"unreachable_patterns" error from Clippy.

* Set the Rust build version to 07-31 for compatibility with Futures

* doc: update README with latest help output

* chore: no need to specify parser explicitly for PathBuf

* update service.rs and command.rs

Based on the diff in polkadot-sdk.

* fix: clippy

* feat: use derive_impl in runtime and remove unused derives

* fix: use Display instead of Debug for rpc error conversion

This is more in line with previous behaviour.

* chore: use official curve-dalek instead of solana fork

* chore: remove unneeded allow(dead_code)

* chore: remove allow(unreachable_patterns)

* chore: adjust comment

* chore: fmt

* chore: remove unused test field

* feat: use test defaults for runtime mocks

* fix: remove old fix for Executive

* chore: remove unused input_to_output_amount_floor

* chore: fmt

* fix: code coverage tests compiler error

---------

Co-authored-by: kylezs <zsembery.kyle@gmail.com>
Co-authored-by: Daniel <daniel@chainflip.io>
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 this pull request may close these issues.

2 participants