1

I was trying to add Frontier template into my substrate-parachain-template project...

when I added this code below in runtime/src/lib.rs:

impl pallet_base_fee::Config for Runtime {
    type Event = Event;
    type Threshold = BaseFeeThreshold;
    type IsActive = IsActive;
    type DefaultBaseFeePerGas = DefaultBaseFeePerGas;
}

I got this error:

    Compiling parachain-template-runtime v0.1.0 (/mnt/sda3/polkadot/substrate-parachain-template-evm/runtime)
...
  error[E0277]: the trait bound `Event: From<pallet_base_fee::Event>` is not satisfied
     --> /mnt/sda3/polkadot/substrate-parachain-template-evm/runtime/src/lib.rs:525:15
      |
  525 |     type Event = Event;
      |                  ^^^^^ the trait `From<pallet_base_fee::Event>` is not implemented for `Event`
      |
      = help: the following other types implement trait `From<T>`:
                <Event as From<cumulus_pallet_dmp_queue::Event<Runtime>>>
                <Event as From<cumulus_pallet_parachain_system::Event<Runtime>>>
                <Event as From<cumulus_pallet_xcm::Event<Runtime>>>
                <Event as From<cumulus_pallet_xcmp_queue::Event<Runtime>>>
                <Event as From<frame_system::Event<Runtime>>>
                <Event as From<pallet_balances::Event<Runtime>>>
                <Event as From<pallet_collator_selection::Event<Runtime>>>
                <Event as From<pallet_ethereum::Event>>
              and 4 others
  note: required by a bound in `pallet_base_fee::Config::Event`
     --> /home/user2038/.cargo/git/checkouts/frontier-b733f450c86c5786/2e4daa4/frame/base-fee/src/lib.rs:49:15
      |
  49  |         type Event: From<Event> + IsType<<Self as frame_system::Config>::Event>;
      |                     ^^^^^^^^^^^ required by this bound in `pallet_base_fee::Config::Event`

  For more information about this error, try `rustc --explain E0277`.

This Event has been used many times in runtime/src/lib.rs.

And those usage below are all working fine:

impl frame_system::Config for Runtime {
    ...
    type Event = Event;
}

impl pallet_balances::Config for Runtime {
    ...
    type Event = Event;
}
impl pallet_evm::Config for Runtime {
    ...
    type Event = Event;
}

impl pallet_ethereum::Config for Runtime {
    ...
    type Event = Event;
}

So I do not know why pallet_base_fee cannot accept it...

What is missing here?

1 Answer 1

2

Did you add pallet-base-fee in the construct_runtime! with Event<T>?

1
  • Adding DynamicFee: pallet_dynamic_fee, solves it. Thank you :)
    – Russo
    Commented Aug 9, 2022 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.