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

Update subxt version #256

Closed
fewensa opened this issue Aug 30, 2021 · 2 comments · Fixed by #255
Closed

Update subxt version #256

fewensa opened this issue Aug 30, 2021 · 2 comments · Fixed by #255
Assignees

Comments

@fewensa
Copy link
Contributor

fewensa commented Aug 30, 2021

Execution failed (exit code 101).
D:/opt/scoop/apps/rustup/current/.cargo/bin/cargo.exe metadata --verbose --format-version 1 --all-features
stdout :     Updating crates.io index
    Updating git repository `https://github.com/darwinia-network/substrate.git`
    Updating git repository `https://github.com/darwinia-network/parity-bridges-common.git`
error: failed to select a version for `jsonrpsee-proc-macros`.
    ... required by package `relay-substrate-client v0.1.0 (https://github.com/darwinia-network/parity-bridges-common.git?branch=main#81b4442a)`
    ... which is depended on by `client-pangolin-s2s v0.4.5 (D:\dev\darwinia-network\bridger\components\client-pangolin-s2s)`
versions that meet the requirements `^0.2` are: 0.2.0

all possible versions conflict with previously selected packages.

  previously selected package `jsonrpsee-proc-macros v0.2.0-alpha.6`
    ... which is depended on by `substrate-subxt v0.15.3 (https://github.com/darwinia-network/substrate-subxt.git?branch=metadata#f744898d)`
    ... which is depended on by `component-darwinia-subxt v0.4.5 (D:\dev\darwinia-network\bridger\components\client-darwinia-subxt)`
    ... which is depended on by `linked-darwinia v0.4.5 (D:\dev\darwinia-network\bridger\task\linked-darwinia)`
    ... which is depended on by `darwinia-bridger v0.4.5 (D:\dev\darwinia-network\bridger\bin)`

failed to select a version for `jsonrpsee-proc-macros` which could resolve this conflict

stderr : 

jsonrpsee-types = "=0.2.0-alpha.6"
jsonrpsee-ws-client = "=0.2.0-alpha.6"
jsonrpsee-http-client = "=0.2.0-alpha.6"

https://github.com/darwinia-network/parity-bridges-common/blob/81b4442a57891added578a0b9c67b2b3fbf3a8f5/relays/client-substrate/Cargo.toml#L12-L13

Incompatible jsonrpsee version appears in the same cargo workspace.

@fewensa fewensa self-assigned this Aug 30, 2021
@AurevoirXavier
Copy link
Member

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

@fewensa
Copy link
Contributor Author

fewensa commented Aug 30, 2021

Some api changed by jsonrpsee, I'm test in substrate-subxt project, it's appears some error.

   --> src\lib.rs:368:21
    |
368 |         if let Some(mut data) = self.rpc.storage(&key, hash).await? {
    |                     ----^^^^
    |                     |
    |                     help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

error[E0308]: mismatched types
   --> src\rpc.rs:553:19
    |
553 |         while let Some(status) = xt_sub.next().await {
    |                   ^^^^^^^^^^^^   ------------------- this expression has type `Result<std::option::Option<TransactionStatus<<T as system::System>::Hash, <T as system::System>::Hash>>, jsonrpsee_http_client::Error>`
    |                   |
    |                   expected enum `Result`, found enum `std::option::Option`
    |
    = note: expected enum `Result<std::option::Option<TransactionStatus<<T as system::System>::Hash, <T as system::System>::Hash>>, jsonrpsee_http_client::Error>`
               found enum `std::option::Option<_>`

   Compiling substrate-subxt-client v0.7.0 (D:\dev\darwinia-network\substrate-subxt\client)
error[E0308]: mismatched types
   --> src\subscription.rs:202:42
    |
202 |             Self::Imported(event_sub) => event_sub.next().await,
    |                                          ^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found enum `Result`
    |
    = note: expected enum `std::option::Option<_>`
               found enum `Result<std::option::Option<_>, jsonrpsee_http_client::Error>`

error[E0432]: unresolved imports `jsonrpsee_types::v2::error::JsonRpcErrorAlloc`, `jsonrpsee_types::v2::parse_request_id`
  --> client\src\lib.rs:45:13
   |
45 |             JsonRpcErrorAlloc,
   |             ^^^^^^^^^^^^^^^^^
   |             |
   |             no `JsonRpcErrorAlloc` in `v2::error`
   |             help: a similar name exists in the module: `JsonRpcError`
...
54 |         parse_request_id,
   |         ^^^^^^^^^^^^^^^^ no `parse_request_id` in `v2`

error[E0308]: try expression alternatives have incompatible types
   --> src\subscription.rs:179:37
    |
179 |             let header: T::Header = self.subscription.next().await?;
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found enum `std::option::Option`
    |
    = note: expected associated type `<T as system::System>::Header`
                          found enum `std::option::Option<<T as system::System>::Header>`
    = help: consider constraining the associated type `<T as system::System>::Header` to `std::option::Option<<T as system::System>::Header>`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: `?` couldn't convert the error to `NoneError`
   --> src\subscription.rs:179:67
    |
179 |             let header: T::Header = self.subscription.next().await?;
    |                                                                   ^ the trait `From<jsonrpsee_http_client::Error>` is not implemented for `NoneError`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = note: required by `std::convert::From::from`
help: consider converting the `Result<T, _>` into an `Option<T>` using `Result::ok`
    |
179 |             let header: T::Header = self.subscription.next().await.ok()?;
    |                                                                   ^^^^^

error[E0599]: no variant or associated item named `TransportError` found for enum `jsonrpsee_types::Error` in the current scope
   --> client\src\lib.rs:283:42
    |
283 |             .map_err(|e| JsonRpseeError::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
   --> client\src\lib.rs:309:42
    |
309 |             .map_err(|e| JsonRpseeError::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
   --> client\src\lib.rs:314:52
    |
314 |             Err(err) => return Err(JsonRpseeError::TransportError(Box::new(err))),
    |                                                    ^^^^^^^^^^^^^^ 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
   --> client\src\lib.rs:354:52
    |
354 |             Err(err) => return Err(JsonRpseeError::TransportError(Box::new(err))),
    |                                                    ^^^^^^^^^^^^^^ variant or associated item not found in `jsonrpsee_types::Error`

error[E0560]: struct `jsonrpsee_types::Subscription<N>` has no field named `id`
   --> client\src\lib.rs:360:13
    |
360 |             id,
    |             ^^ `jsonrpsee_types::Subscription<_>` does not have this field

error[E0609]: no field `result` on type `JsonValue`
   --> client\src\lib.rs:221:64
    |
221 | ...                   .send(notif.params.result)
    |                                          ^^^^^^

error[E0559]: variant `sc_service::Role::Authority` has no field named `sentry_nodes`
   --> client\src\lib.rs:380:21
    |
380 |                     sentry_nodes: Default::default(),
    |                     ^^^^^^^^^^^^ `sc_service::Role::Authority` does not have this field

error[E0560]: struct `Configuration` has no field named `telemetry_handle`
   --> client\src\lib.rs:467:13
    |
467 |             telemetry_handle: Default::default(),
    |             ^^^^^^^^^^^^^^^^ `Configuration` does not have this field
    |
    = note: available fields are: `impl_name`, `impl_version`, `role`, `task_executor`, `transaction_pool` ... and 34 others

error[E0560]: struct `Configuration` has no field named `telemetry_span`
   --> client\src\lib.rs:468:13
    |
468 |             telemetry_span: Default::default(),
    |             ^^^^^^^^^^^^^^ `Configuration` does not have this field
    |
    = note: available fields are: `impl_name`, `impl_version`, `role`, `task_executor`, `transaction_pool` ... and 34 others

error: aborting due to 10 previous errors

Some errors have detailed explanations: E0432, E0559, E0560, E0599, E0609.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `substrate-subxt-client`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: aborting due to 4 previous errors; 1 warning emitted

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: build failed

@AurevoirXavier AurevoirXavier linked a pull request Aug 30, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants