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

feat: Add CrowdloanRewards pallet #18

Conversation

ltfschoen
Copy link
Contributor

@ltfschoen ltfschoen commented Mar 13, 2022

i get this error when i try to implement these changes:

error[E0277]: the trait bound `sp_runtime::generic::UncheckedExtrinsic<MultiAddress<sp_runtime::AccountId32, ()>, Call, MultiSignature, (CheckNonZeroSender<Runtime>, CheckSpecVersion<Runtime>, CheckTxVersion<Runtime>, CheckGenesis<Runtime>, CheckEra<Runtime>, CheckNonce<Runtime>, CheckWeight<Runtime>, ChargeTransactionPayment<Runtime>)>: Encode` is not satisfied
      --> /Users/ls2/code/DataHighway-DHX/DataHighway-Parachain/runtime/src/lib.rs:1441:38
       |
  1441 |         fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {
       |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `sp_runtime::generic::UncheckedExtrinsic<MultiAddress<sp_runtime::AccountId32, ()>, Call, MultiSignature, (CheckNonZeroSender<Runtime>, CheckSpecVersion<Runtime>, CheckTxVersion<Runtime>, CheckGenesis<Runtime>, CheckEra<Runtime>, CheckNonce<Runtime>, CheckWeight<Runtime>, ChargeTransactionPayment<Runtime>)>`
       |
       = help: the following implementations were found:
                 <sp_runtime::generic::UncheckedExtrinsic<Address, Call, Signature, Extra> as Encode>
       = note: required because of the requirements on the impl of `Codec` for `sp_runtime::generic::UncheckedExtrinsic<MultiAddress<sp_runtime::AccountId32, ()>, Call, MultiSignature, (CheckNonZeroSender<Runtime>, CheckSpecVersion<Runtime>, CheckTxVersion<Runtime>, CheckGenesis<Runtime>, CheckEra<Runtime>, CheckNonce<Runtime>, CheckWeight<Runtime>, ChargeTransactionPayment<Runtime>)>`
       = note: required because of the requirements on the impl of `sp_api::BlockT` for `sp_runtime::generic::Block<sp_runtime::generic::Header<u32, sp_runtime::traits::BlakeTwo256>, sp_runtime::generic::UncheckedExtrinsic<MultiAddress<sp_runtime::AccountId32, ()>, Call, MultiSignature, (CheckNonZeroSender<Runtime>, CheckSpecVersion<Runtime>, CheckTxVersion<Runtime>, CheckGenesis<Runtime>, CheckEra<Runtime>, CheckNonce<Runtime>, CheckWeight<Runtime>, ChargeTransactionPayment<Runtime>)>>`

  error[E0277]: the trait bound `pallet_crowdloan_rewards::Pallet<Runtime>: Callable<Runtime>` is not satisfied in `Call`
      --> /Users/ls2/code/DataHighway-DHX/DataHighway-Parachain/runtime/src/lib.rs:1441:39
       |
  1441 |         fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {
       |                                             ^^^^^ within `Call`, the trait `Callable<Runtime>` is not implemented for `pallet_crowdloan_rewards::Pallet<Runtime>`
       |
  note: required because it appears within the type `Call`
      --> /Users/ls2/code/DataHighway-DHX/DataHighway-Parachain/runtime/src/lib.rs:1237:1
       |
  651  |  | parameter_types! {
       |  |_________^
  ...
  1237 |    construct_runtime!(
       |   _^
       |  |_|
       | ||
  1238 | |      pub enum Runtime where
  1239 | |          Block = Block,
  1240 | |          NodeBlock = opaque::Block,
  ...    |
  1320 | |      }
  1321 | |  );
       | |__- in this macro invocation
  note: required by a bound in `sp_runtime::generic::UncheckedExtrinsic`
      --> /Users/ls2/.cargo/git/checkouts/substrate-7e08433d4c370a21/22d40c7/primitives/runtime/src/generic/unchecked_extrinsic.rs:44:40
       |
  44   | pub struct UncheckedExtrinsic<Address, Call, Signature, Extra>
       |                                        ^^^^ required by this bound in `sp_runtime::generic::UncheckedExtrinsic`
       = note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)

so i tried adding the following

impl pallet_crowdloan_rewards::Config for Runtime {
    ...
    type Currency = Balances;
    ... 

and removing Call as follows CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config<T>, to CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Config<T>,

but i still get further errors

  note: required because it appears within the type `Event`
      --> /Users/ls2/code/DataHighway-DHX/DataHighway-Parachain/runtime/src/lib.rs:1237:1
       |
  651  |  | parameter_types! {
       |  |_________^
  ...
  1237 |    construct_runtime!(
       |   _^
       |  |_|
       | ||
  1238 | |      pub enum Runtime where
  1239 | |          Block = Block,
  1240 | |          NodeBlock = opaque::Block,
  ...    |
  1320 | |      }
  1321 | |  );
       | |__- in this macro invocation
  note: required by a bound in `Decode`
      --> /Users/ls2/.cargo/registry/src/github.com-1ecc6299db9ec823/parity-scale-codec-2.3.1/src/codec.rs:277:19
       |
  277  | pub trait Decode: Sized {
       |                   ^^^^^ required by this bound in `Decode`
       = note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::codec::Decode` (in Nightly builds, run with -Z macro-backtrace for more info)

  error[E0277]: the trait bound `Runtime: frame_system::pallet::Config` is not satisfied in `Event`
      --> /Users/ls2/code/DataHighway-DHX/DataHighway-Parachain/runtime/src/lib.rs:1237:1
       |
  651  |  | parameter_types! {
       |  |_________^ within `Event`, the trait `frame_system::pallet::Config` is not implemented for `Runtime`
  ...
  1237 |    construct_runtime!(
       |   _^
       |  |_|
       | ||
  1238 | |      pub enum Runtime where
  1239 | |          Block = Block,
  1240 | |          NodeBlock = opaque::Block,
  ...    |
  1320 | |      }
  1321 | |  );
       | |__- in this macro invocation
       |
  note: required because it appears within the type `Event`
      --> /Users/ls2/code/DataHighway-DHX/DataHighway-Parachain/runtime/src/lib.rs:1237:1
       |
  651  |  | parameter_types! {
       |  |_________^
  ...
  1237 |    construct_runtime!(
       |   _^
       |  |_|
       | ||
  1238 | |      pub enum Runtime where
  1239 | |          Block = Block,
  1240 | |          NodeBlock = opaque::Block,
  ...    |
  1320 | |      }
  1321 | |  );
       | |__- in this macro invocation
  note: required by a bound in `Result`
      --> /Users/ls2/.rustup/toolchains/nightly-2021-12-15-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:503:17
       |
  503  | pub enum Result<T, E> {
       |                 ^ required by this bound in `Result`
       = note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::codec::Decode` (in Nightly builds, run with -Z macro-backtrace for more info)

  error[E0277]: the trait bound `pallet_balances::Pallet<Runtime>: frame_support::traits::tokens::currency::Currency<_>` is not satisfied in `Event`
      --> /Users/ls2/code/DataHighway-DHX/DataHighway-Parachain/runtime/src/lib.rs:1237:1
       |
  651  |  | parameter_types! {
       |  |_________^ within `Event`, the trait `frame_support::traits::tokens::currency::Currency<_>` is not implemented for `pallet_balances::Pallet<Runtime>`
  ...
  1237 |    construct_runtime!(
       |   _^
       |  |_|
       | ||
  1238 | |      pub enum Runtime where
  1239 | |          Block = Block,
  1240 | |          NodeBlock = opaque::Block,
  ...    |
  1320 | |      }
  1321 | |  );
       | |__- in this macro invocation
       |
  note: required because it appears within the type `Event`
      --> /Users/ls2/code/DataHighway-DHX/DataHighway-Parachain/runtime/src/lib.rs:1237:1
       |
  651  |  | parameter_types! {
       |  |_________^
  ...
  1237 |    construct_runtime!(
       |   _^
       |  |_|
       | ||
  1238 | |      pub enum Runtime where
  1239 | |          Block = Block,
  1240 | |          NodeBlock = opaque::Block,
  ...    |
  1320 | |      }
  1321 | |  );
       | |__- in this macro invocation
  note: required by a bound in `Result`
      --> /Users/ls2/.rustup/toolchains/nightly-2021-12-15-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:503:17
       |
  503  | pub enum Result<T, E> {
       |                 ^ required by this bound in `Result`

so i created this issue moonbeam-foundation/crowdloan-rewards#52

@ltfschoen ltfschoen added the help wanted Extra attention is needed label Mar 13, 2022
@ltfschoen
Copy link
Contributor Author

closing temporarily. added to #20 incase we need it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant