sunshine-protocol / sunshine

Governance + Bounty Platform
Other
43 stars 16 forks source link

more testing #46

Closed 4meta5 closed 4 years ago

4meta5 commented 4 years ago

I'm updating everything to substrate master and am getting this error message when I run cargo build in node.

error[E0271]: type mismatch resolving `for<'r> <for<'s> fn(&'s str) -> std::result::Result<std::option::Option<sc_chain_spec::chain_spec::ChainSpec<suntime::GenesisConfig>>, std::string::String> {chain_spec::load_spec} as std::ops::FnOnce<(&'r str,)>>::Output == std::result::Result<std::boxed::Box<(dyn sc_chain_spec::ChainSpec + 'static)>, std::string::String>`
  --> node/src/command.rs:33:24
   |
33 |             subcommand.update_config(&mut config, chain_spec::load_spec, &version)?;
   |                        ^^^^^^^^^^^^^ expected enum `std::option::Option`, found struct `std::boxed::Box`
   |
   = note: expected enum `std::result::Result<std::option::Option<sc_chain_spec::chain_spec::ChainSpec<suntime::GenesisConfig>>, _>`
              found enum `std::result::Result<std::boxed::Box<(dyn sc_chain_spec::ChainSpec + 'static)>, _>`

error[E0271]: type mismatch resolving `for<'r> <for<'s> fn(&'s str) -> std::result::Result<std::option::Option<sc_chain_spec::chain_spec::ChainSpec<suntime::GenesisConfig>>, std::string::String> {chain_spec::load_spec} as std::ops::FnOnce<(&'r str,)>>::Output == std::result::Result<std::boxed::Box<(dyn sc_chain_spec::ChainSpec + 'static)>, std::string::String>`
  --> node/src/command.rs:41:18
   |
41 |                 .update_config(&mut config, chain_spec::load_spec, &version)?;
   |                  ^^^^^^^^^^^^^ expected enum `std::option::Option`, found struct `std::boxed::Box`
   |
   = note: expected enum `std::result::Result<std::option::Option<sc_chain_spec::chain_spec::ChainSpec<suntime::GenesisConfig>>, _>`
              found enum `std::result::Result<std::boxed::Box<(dyn sc_chain_spec::ChainSpec + 'static)>, _>`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.
error: could not compile `sunshine-node`.

To learn more, run the command again with --verbose.
4meta5 commented 4 years ago

debugged the error with this specific change and the one directly below it, thanks Joshy https://github.com/substrate-developer-hub/substrate-node-template/pull/27/files#diff-e886fc1729ba8103c7276930f837b057R145

4meta5 commented 4 years ago

TODO before merging:

rev='8c1858048148c1c717123b0e4d360f8ad1be5bf2'
4meta5 commented 4 years ago

Currently, there is some dependency leak in subxt. When I build, it's compiling two different versions and I'm not sure why.

   Compiling sp-runtime v2.0.0-alpha.5
   Compiling sp-runtime v2.0.0-alpha.5 (https://github.com/paritytech/substrate.git#8c185804)

The errors corroborate this diagnosis:

error[E0277]: the trait bound `sp_runtime::OpaqueExtrinsic: sp_runtime::traits::Extrinsic` is not satisfied
   --> subxt/src/main.rs:30:5
    |
22  | impl System for Runtime {
    | ----------------------- in this `impl` item
...
30  |     type Extrinsic = OpaqueExtrinsic;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `sp_runtime::traits::Extrinsic` is not implemented for `sp_runtime::OpaqueExtrinsic`
    | 
   ::: /Users/4meta5/.cargo/git/checkouts/substrate-subxt-806f8a6088009705/bb46578/src/frame/system.rs:125:10
    |
125 |     type Extrinsic: Parameter + Member + Extrinsic + Debug + MaybeSerializeDeserialize;
    |          --------- associated type defined here
    |
help: trait impl with same name found
   --> /Users/4meta5/.cargo/git/checkouts/substrate-7e08433d4c370a21/8c18580/primitives/runtime/src/lib.rs:728:1
    |
728 | / impl traits::Extrinsic for OpaqueExtrinsic {
729 | |     type Call = ();
730 | |     type SignaturePayload = ();
731 | | }
    | |_^
    = note: perhaps two different versions of crate `sp_runtime` are being used?

error[E0277]: the trait bound `sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo256>: sp_runtime::traits::Header` is not satisfied
   --> subxt/src/main.rs:29:5
    |
22  | impl System for Runtime {
    | ----------------------- in this `impl` item
...
29  |     type Header = Header<Self::BlockNumber, BlakeTwo256>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `sp_runtime::traits::Header` is not implemented for `sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo256>`
    | 
   ::: /Users/4meta5/.cargo/git/checkouts/substrate-subxt-806f8a6088009705/bb46578/src/frame/system.rs:120:10
    |
120 |     type Header: Parameter
    |          ------ associated type defined here
    |
help: trait impl with same name found
   --> /Users/4meta5/.cargo/git/checkouts/substrate-7e08433d4c370a21/8c18580/primitives/runtime/src/generic/header.rs:123:1
    |
123 | / impl<Number, Hash> traits::Header for Header<Number, Hash> where
124 | |     Number: Member + MaybeSerializeDeserialize + Debug + sp_std::hash::Hash + MaybeDisplay +
125 | |         AtLeast32Bit + Codec + Copy + Into<U256> + TryFrom<U256> + sp_std::str::FromStr +
126 | |         MaybeMallocSizeOf,
...   |
169 | |     }
170 | | }
    | |_^
    = note: perhaps two different versions of crate `sp_runtime` are being used?

error[E0277]: the trait bound `sp_runtime::traits::BlakeTwo256: sp_runtime::traits::Hash` is not satisfied
   --> subxt/src/main.rs:26:5
    |
22  | impl System for Runtime {
    | ----------------------- in this `impl` item
...
26  |     type Hashing = BlakeTwo256;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `sp_runtime::traits::Hash` is not implemented for `sp_runtime::traits::BlakeTwo256`
    | 
   ::: /Users/4meta5/.cargo/git/checkouts/substrate-subxt-806f8a6088009705/bb46578/src/frame/system.rs:105:10
    |
105 |     type Hashing: Hash<Output = Self::Hash>;
    |          ------- associated type defined here
    |
help: trait impl with same name found
   --> /Users/4meta5/.cargo/git/checkouts/substrate-7e08433d4c370a21/8c18580/primitives/runtime/src/traits.rs:362:1
    |
362 | / impl Hash for BlakeTwo256 {
363 | |     type Output = sp_core::H256;
364 | |
365 | |     fn trie_root(input: Vec<(Vec<u8>, Vec<u8>)>) -> Self::Output {
...   |
371 | |     }
372 | | }
    | |_^
    = note: perhaps two different versions of crate `sp_runtime` are being used?

error: aborting due to 3 previous errors