Questions tagged [frame]
Questions about Substrate's framework for developing custom runtime logic.
14
questions
6
votes
1
answer
202
views
Why is there no `Default` implementation for `T::AccountId`?
Starting with version 9.17 and greater I started getting these errors for the custom pallets I've made. Could I please get a pointer in resolving this issue? Example output from compiler:
#[derive(...
6
votes
2
answers
283
views
How do treasury accounts compare to end user accounts in FRAME?
I would like to understand how treasury accounts are created and used under the hood. How do they compare to end user accounts? Are they also just an AccountId to AccountInfo map in storage?
16
votes
1
answer
239
views
When to use `BoundedVec` vs. `WeakBoundedVec` vs. `Vec`?
Are there any guiding principles that can be applied to decide whether to use Substrate's BoundedVec, WeakBoundedVec, or Vec in a runtime?
Is it a general rule of thumb to use the bounded variant ...
8
votes
1
answer
216
views
How does a Substrate chain set the max total supply?
How does a Substrate chain set the max total supply? Looking at the staking module, each era will increase the total_issuance through the issue. In the issue function, Self::Balance::max_value() is ...
22
votes
3
answers
695
views
When should I build a Substrate FRAME Pallet versus a Smart Contract?
What are the differences between developing a Substrate FRAME Pallet and a Substrate Smart Contract (for example with the ink! language)?
What are some examples of applications which are best written ...
12
votes
2
answers
571
views
How to fix `parity_scale_codec::MaxEncodedLen` is not implemented for `T`?
When building my pallet, I run into the error:
error[E0277]: the trait bound `T: parity_scale_codec::MaxEncodedLen` is not satisfied
--> pallets/template/src/lib.rs:42:15
|
42 | #[pallet::...
5
votes
1
answer
93
views
adding an account
I just want to simply add an account in the development config but have no idea how to do it, i tried simply adding the seed in the development_config function but it dosent work, what can i do to add ...
6
votes
1
answer
172
views
How do I use storage and functions from one custom pallet in another?
Is there a way for one custom pallet to access the storage or functions from another custom pallet?
For Example:
Pallet 1
#[pallet::storage]
pub(super) type MyValue<T: Config> = StorageValue<...
5
votes
2
answers
174
views
<T::Lookup as StaticLookup>::Source vs T::AccountId?
I noticed https://github.com/paritytech/substrate/issues/6042 was recently resolved, replacing T::AccountId with <T::Lookup as StaticLookup>::Source. Substrate docs don't mention what is the ...
4
votes
1
answer
134
views
How can I configure genesis state for my pallet's tests without hardcoding it?
I've been writing tests for pallet-kitties and have configured the genesis state inside my mock runtime by setting the storage items for two kitties (one Male and one Female) and their owners (with ...
4
votes
1
answer
86
views
Whitelist a call subset of a pallet
Is there a way to whitelist a call subset of a pallet? And hide the rest from the end user.
// something like
Pallet { fn call_a(){} fn call_b(){} }; // Some Pallet
...
construct_runtime!(
pub ...
3
votes
1
answer
131
views
Problem running assert_last_event in tests.rs
As the title suggests, I've been trying to call assert_last_event on the tests.rs class without success. The problem first happened when developing the kitties tutorial and after several toolchain ...
2
votes
1
answer
262
views
Node that was not modified fails to build
I had a fully functioning node that was built about 4 day ago and I was using it. Today I've decided to rebuild it with cargo build -r and for some reason if failed to build with absolutely weird ...
1
vote
1
answer
28
views
How does the pay_tips parameter work for NFTs?
Who is it voluntary for? The buyer or the creator of the NFT?
Does the tip get awarded to the creator after every transfer?
Is it voluntary for the buyer each time or is it only voluntary during the ...