Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions about Runtime Modules built with the FRAME developer SDK.
2
votes
Is it possible to disable new validators from joining?
The given answer does not work and can easily be circumvented with proxy, multi-sig, batch, or any other type of call wrapping.
The better way to do this would be to set MaxValidatorCount to 0. Then n …
3
votes
Accepted
Can I store a HashMap in StorageMap?
You should use BTreeMap, HashMap isn't available for the runtime storage.
The underlying reason being that HashMaps have undeterministic behavior, therefore could likely break your consensus. Otherw …
0
votes
How to do a manual implementation for 'AccountId'
The rule in the Rust programming language is:
If you implement trait U for type T, either T or U must live in your crate. In this case, neither do, so you cannot do that.
The standard fix for this, ca …
2
votes
Accepted
What is the meaning of trait `Member`?
This trait seem to have been added years ago and hasn't had much change ever since. I think the primary purpose is to simply be the super-trait number of other sub-traits and be used for any type that …
1
vote
Setting static parameter types in benchmarks
Other than Oliver's answer, I want to point out that you are likely having the wrong mental model here.
Your benchmarking code receives T, including T::HeadersToKeep and all the other configurations a …
4
votes
Accepted
<wasm:stripped> printed when logging from the runtime
When a type derives RuntimeDebug instead of Debug, then this string literal is printed ONLY in wasm. You have two options here:
Run native via --execution Native.
Change the derive, and make sure the …
3
votes
Accepted
Pallet session: QueuedKeys vs NextKeys
The main point that you are missing is that NextKeys can only be set via the set_keys transaction.
Once a new session is being enacted, if the validator set has changed, QueuedKeys is formed from the …
1
vote
Dynamic function weights
In short, any components that can influence the weight should be added to the weight function as a component.
For example, in the case of on_initialize, if it depends in block_number and an arbitrary …
1
vote
How to query for All Pallets StorageVersions
Getting the pallet version from polkadot-js-api is as simple as:
await api.query.system.palletVersion()
You can wrap this in a script to give you all of the pallet versions: …
0
votes
How can I access a value obtained at runtime in primitives npos elections?
Then, if you want to use it in the runtime, alongside the staking pallet, all you have to do is implement trait NpoSolver for your new implementation. …
3
votes
Accepted
DispatchError::Other(_) always being mapped to DispatchError::Other("")
The reason goes back to the fact that DispatchError::Other has a special annotation that nullifies the encoding of the inner &'static str:
pub enum DispatchError {
/// Some error occurred.
Oth …
4
votes
Accepted
how to get the current block author?
You can do so by implementing the pallet_authorship::EventHandler. pallet-collator-selection does exactly this, which is a pretty straightforward example. … Then, in the top level runtime, any pallet who's interested in receiving these events about block authorship has to be passed to the authorship pallet:
// in your pallet
impl<T: Config> pallet_authorship …
1
vote
Accepted
What is the most standard pallet structure in Substrate?
aside from the outer
#[pallet]
mod pallet {}
and the fact that everything needs to be inside of this, internals of a pallet are almost entirely normal Rust and the mentioned items can appear anywhere …