Questions tagged [traits]
The traits tag has no usage guidance.
12
questions
1
vote
1
answer
92
views
Customizing AccountId
In my runtime I'm using pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;. Within my pallet I also need this type to implement From<SomeType>. I ...
5
votes
1
answer
70
views
Trait item implementation is missing: `reserve_withdraw_assets`
I am running the Astar node locally and pointing to the astar-frame repository which is cloned on my local machine. In the Astar node repository, I added the paths-override method to the point all ...
2
votes
1
answer
64
views
How can I convert an account of type sp_runtime::traits::IdentifyAccount::AccountId to sp_runtime::AccountId32?
I get the following error when trying to convert my frame_system::Config::AccountId to a MultiAddress.
expected enum `MultiAddress<sp_runtime::AccountId32, ()>`
found enum `MultiAddress<&...
0
votes
1
answer
39
views
frontier template upgrade to polkadotv0.9.38 but using Babe instead of Aura
I've upgraded the frontier-node-template to substrate polkadot-v0.9.38, I've fixed all issues in runtime, migrated my code as well.
But since last few days, I'm stuck in converting service.rs file in ...
1
vote
1
answer
60
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
28
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
42
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
61
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
150
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
51
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
246
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
610
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 ...