nervosnetwork / capsule

Capsule is an out-of-box development framework for creating smart contract on Nervos' CKB.
MIT License
60 stars 34 forks source link

When installing capsule , the trait error occurred #144

Closed duanyytop closed 6 months ago

duanyytop commented 6 months ago

Describe the bug When I want to install the latest capsule with cargo install ckb-capsule, the following error occurred

   Compiling ckb-testtool v0.10.2
error[E0277]: the trait bound `ckb_testtool::ckb_types::packed::Script: From<&ckb_sdk::Address>` is not satisfied
   --> /home/dylan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ckb-capsule-0.10.3/src/wallet/wallet.rs:246:25
    |
246 |         (&self.address).into()
    |                         ^^^^ the trait `From<&ckb_sdk::Address>` is not implemented for `ckb_testtool::ckb_types::packed::Script`
    |
    = help: the trait `From<ckb_testtool::ckb_jsonrpc_types::Script>` is implemented for `ckb_testtool::ckb_types::packed::Script`
    = help: for that trait implementation, expected `ckb_testtool::ckb_jsonrpc_types::Script`, found `&ckb_sdk::Address`
    = note: required for `&ckb_sdk::Address` to implement `Into<ckb_testtool::ckb_types::packed::Script>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `ckb-capsule` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `ckb-capsule v0.10.3`, intermediate artifacts can be found at `/tmp/cargo-installbfVeNS`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Additional context Please post the following informations:

   Compiling ckb-pow v0.111.0
   Compiling ckb-chain-spec v0.112.1
   Compiling ckb-mock-tx-types v0.112.1
   Compiling ckb-resource v0.111.0
   Compiling ckb-dao v0.112.1
   Compiling ckb-chain-spec v0.111.0
   Compiling ckb-mock-tx-types v0.111.0
   Compiling ckb-verification v0.112.1
   Compiling ckb-sdk v3.0.1
   Compiling ckb-testtool v0.10.2
error[E0277]: the trait bound `ckb_testtool::ckb_types::packed::Script: From<&ckb_sdk::Address>` is not satisfied
   --> /home/dylan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ckb-capsule-0.10.3/src/wallet/wallet.rs:246:25
    |
246 |         (&self.address).into()
    |                         ^^^^ the trait `From<&ckb_sdk::Address>` is not implemented for `ckb_testtool::ckb_types::packed::Script`
    |
    = help: the trait `From<ckb_testtool::ckb_jsonrpc_types::Script>` is implemented for `ckb_testtool::ckb_types::packed::Script`
    = help: for that trait implementation, expected `ckb_testtool::ckb_jsonrpc_types::Script`, found `&ckb_sdk::Address`
    = note: required for `&ckb_sdk::Address` to implement `Into<ckb_testtool::ckb_types::packed::Script>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `ckb-capsule` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `ckb-capsule v0.10.3`, intermediate artifacts can be found at `/tmp/cargo-installqEO3AO`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
TheWaWaR commented 6 months ago

I think it's because v0.112.1 packages mismatch v0.111.0 packages. Should stick the version use crate = "=xx.11" some where.