paritytech / subport

Parity Substrate(-based) chains usage and development support
https://docs.substrate.io
Apache License 2.0
83 stars 13 forks source link

meet "unresolved import `crate::v2::error::JsonRpcErrorAlloc`" when I cargo check after update toml lib to "polkadot-v0.9.3" #175

Closed todaylab closed 3 years ago

todaylab commented 3 years ago

I update lib to "polkadot-v0.9.3" in root dir Cargo.toml

I modify the Cargo.toml like

xxx = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.3" }

xxxx = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.3" }

I run "cargo check " and report error.

 Checking sp-keystore v0.9.0 (https://github.com/paritytech/substrate?branch=polkadot-v0.9.3#85fa0ab8)
error[E0432]: unresolved import `crate::v2::error::JsonRpcErrorAlloc`
 --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:5:2
  |
5 |     error::JsonRpcErrorAlloc,
  |     ^^^^^^^-----------------
  |     |      |
  |     |      help: a similar name exists in the module: `JsonRpcError`
  |     no `JsonRpcErrorAlloc` in `v2::error`

    Checking frame-metadata v13.0.0 (https://github.com/paritytech/substrate?branch=polkadot-v0.9.3#85fa0ab8)
error[E0599]: no variant or associated item named `TransportError` found for enum `jsonrpsee_types::Error` in the current scope
  --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:31:24
   |
31 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
   |                                 ^^^^^^^^^^^^^^ variant or associated item not found in `jsonrpsee_types::Error`

error[E0599]: no variant or associated item named `TransportError` found for enum `jsonrpsee_types::Error` in the current scope
  --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:58:24
   |
58 |             .map_err(|e| Error::TransportError(Box::new(e)))
   |                                 ^^^^^^^^^^^^^^ variant or associated item not found in `jsonrpsee_types::Error`

error[E0599]: no variant or associated item named `TransportError` found for enum `jsonrpsee_types::Error` in the current scope
  --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:74:24
   |
74 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
   |                                 ^^^^^^^^^^^^^^ variant or associated item not found in `jsonrpsee_types::Error`

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
  --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:70:7
   |
70 |         let body = self
   |             ^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `[u8]`
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
  --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:70:14
   |
70 |           let body = self
   |  ____________________^
71 | |             .transport
72 | |             .send_and_read_body(serde_json::to_string(&request).map_err(Error::ParseError)?)
73 | |             .await
74 | |             .map_err(|e| Error::TransportError(Box::new(e)))?;
   | |_____________________________________________________________^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `[u8]`
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
  --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:74:52
   |
74 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
   |                                                             ^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `[u8]`
   = note: required by `Err`

error[E0308]: mismatched types
  --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:84:38
   |
84 |         let response_id = parse_request_id(response.id)?;
   |                                            ^^^^^^^^^^^ expected enum `std::option::Option`, found enum `Id`
   |
   = note: expected enum `std::option::Option<&jsonrpsee_types::JsonRawValue>`
              found enum `Id<'_>`

error[E0599]: no variant or associated item named `TransportError` found for enum `jsonrpsee_types::Error` in the current scope
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:113:24
    |
113 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
    |                                 ^^^^^^^^^^^^^^ variant or associated item not found in `jsonrpsee_types::Error`

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:109:7
    |
109 |         let body = self
    |             ^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[u8]`
    = note: all local variables must have a statically known size
    = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:109:14
    |
109 |           let body = self
    |  ____________________^
110 | |             .transport
111 | |             .send_and_read_body(serde_json::to_string(&batch_request).map_err(Error::ParseError)?)
112 | |             .await
113 | |             .map_err(|e| Error::TransportError(Box::new(e)))?;
    | |_____________________________________________________________^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[u8]`
    = note: all local variables must have a statically known size
    = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:113:52
    |
113 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
    |                                                             ^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[u8]`
    = note: required by `Err`

error[E0308]: mismatched types
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:126:39
    |
126 |             let response_id = parse_request_id(rp.id)?;
    |                                                ^^^^^ expected enum `std::option::Option`, found enum `Id`
    |
    = note: expected enum `std::option::Option<&jsonrpsee_types::JsonRawValue>`
               found enum `Id<'_>`

error: aborting due to 13 previous errors

Some errors have detailed explanations: E0277, E0308, E0432, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `jsonrpsee-http-client`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
^C  Building [==================>     ] 960/1178: polka-domain-runtime(build), westend-runtime(build), kusama-runtime(build)...
al3mart commented 3 years ago

As proposed by @zqhxuyuan:matrix.org at Rococo element channel this solves the JsonSpree version issue.

cargo update -p jsonrpsee-utils --precise 0.2.0-alpha.6 && cargo update -p jsonrpsee-types --precise 0.2.0-alpha.6