Questions tagged [traits]
The traits tag has no usage guidance.
8
questions
1
vote
1
answer
56
views
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:
...
0
votes
1
answer
21
views
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 ...
2
votes
1
answer
35
views
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?
3
votes
2
answers
47
views
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 ...
2
votes
1
answer
132
views
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>::...
3
votes
1
answer
47
views
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:...
5
votes
3
answers
151
views
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 ...
5
votes
1
answer
350
views
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 ...