Questions tagged [traits]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

How to implement the `Get` trait for a `Pallet<T>`?

I'm writing a pallet that implements evm::executor::stack::PrecompileSet. The goal is to use this pallet in conjunction with Frontier's pallet-evm, which has the following types in its Config trait: ...
Bernardo Rodrigues's user avatar
0 votes
1 answer

Multiple test mock runtimes with slightly different configs based off common base?

We have some custom pallet unit tests that use multiple mock runtimes that are configured slightly differently. The problem is that when we have to make changes to the runtime, we have to apply those ...
Robert La Ferla's user avatar
2 votes
1 answer

frame_support::traits::OnInitialize vs frame_support::traits::Hooks

Both of these have on_initialize calls. What's the difference? When is one run vs the other? Why are these separate concepts?
Kyle's user avatar
  • 248
3 votes
2 answers

What is the difference between `Lookup` and `StaticLookup`?

The docs say that StaticLookup does not require "context" whereas Lookup does. What does this mean? Is there an example or a pallet where we can look at both Lookup and StaticLookup ...
Purple_Turtle's user avatar
2 votes
1 answer

trait bound MaxEncodedLen is not satisfied/not implemented for `RewardInfo<T>` or `<T as pallet::Config>::RelayChainAccountId`

My code for this crowdloan rewards pallet #[pallet::config] pub trait Config: frame_system::Config { type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::...
Russo's user avatar
  • 1,033
3 votes
1 answer

Basics > Runtime > Core primitives > frame_system / node_primitives vs core primitives / Docu of a Pallet configuration trait [closed]

My questions relate to Core Primitives for setting up a node with FRAME. Do I include the Core Primitives by using the Crate frame_system or Crate node_primitives? The core primitives mentioned here:...
Cindita's user avatar
  • 95
5 votes
3 answers

Missing trait problem

Hello the following code snippet is giving me headaches: mod items; pub use super::*; pub use crate::roles::items::*; pub type BalanceOf<T> = <<T as pallet::Config>::Currency as ...
Kazunobu Ndong's user avatar
5 votes
1 answer

Cannot infer type for type parameter 'T'

I have a function using the following 2 types: pub type BalanceOf<T> = <<T as pallet::Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance; pub ...
Kazunobu Ndong's user avatar