Questions tagged [generics]
The generics tag has no usage guidance.
5
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:
...
1
vote
1
answer
85
views
How to create a RuntimeCall with custom values and submit it to the utility pallet's batch function?
I have a custom pallet that is tightly coupled to the utility pallet. I am trying to call the batch function to perform a batch of balance transfers. The tests of the utility pallet (that create ...
1
vote
1
answer
114
views
Type casting to trait. T as Config
this is rust-based question.
In Substrate code, there are lots of type casting. For example,
for the BalanceOf type alias,
<<T as Config>::Currency as Currency<<T as frame_system::...
4
votes
1
answer
94
views
How does `#[codec(mel_bound())]` work?
When declaring types, with generic parameters, to be stored in runtime storage, it’s common to see this pattern
#[derive(Encode, Decode, MaxEncodedLen, TypeInfo)]
pub struct MyItem<TypeA, TypeB> ...
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 ...