3
votes
(FIXED) Substrate forkless upgrade tutorial: pallet_scheduler has breaking changes
Indeed, there is a new version for the Scheduler pallet and the tutorial needs to be updated according to it. This pull request mentions the necessary changes. In the meantime, just set the following ...
3
votes
Explanation on this syntax: pub trait Config<I: 'static = ()>: frame_system::Config
Let's break it down:
pub trait Config<I: 'static = ()>: frame_system::Config
---------------- +++++++++++++++ xxxxxxxxxxxxxxxxxxxx
Every pallet has a trait Config which allows you to ...
2
votes
Accepted
How does one block specific accounts from calling extrinsics for a substrate pallet?
I think the best option you have here is using a SignExtension. There, you can filter by who (checking a whitelisted list in storage), for those signed call that match with pallet_democracy::Call::...
2
votes
How does one block specific accounts from calling extrinsics for a substrate pallet?
One easy way to do this without needing to change the pallet code too much, as you said, is using signed extensions. Here's one that does a similar thing:
https://github.com/paritytech/substrate/pull/...
2
votes
Accepted
How can I convert an account of type sp_runtime::traits::IdentifyAccount::AccountId to sp_runtime::AccountId32?
You can add a trait to do this.
#[pallet::config]
trait Config: frame_system::Config {
AccountIdConvertor: AccountIdConvertor<Self::AccountId>;
}
trait AccountIdConvertor<A> {
fn ...
2
votes
Accepted
how to implement Config of a pallet for runtime
It is not really about "estimation" about most of these types! I think the general thing that is lacking here is documentation and a fundamental understanding of what Config and all these ...
1
vote
EnsureOriginBy using an account set on a pallet's storage
type Who in EnsureSignedBy<Who, AccountId> is bounded by SortedMembers trait. Implement this either for your pallet or for a custom struct:
pub struct AuthorityProvider<T: crate::Config>(...
1
vote
Accepted
Customizing AccountId
Outdated
The error message is still unclear. It appears that the error
originated from the runtime instead of the pallet. When passing
AccountId = YourImplementation, YourImplementation must meet all
...
1
vote
Accepted
Trait item implementation is missing: `reserve_withdraw_assets`
I applied a temporary fix which was to rename the pallet-xcm dependency to astar-xcm in astar-frame and Astar to avoid dependency conflicts with the pallet-xcm subdependency from polkadot-runtime.
1
vote
how to implement Config of a pallet for runtime
It's arbitrary.
You'd better start from the node-template's parameters.
https://github.com/substrate-developer-hub/substrate-node-template
Or you can take a look at the Polkadot/Kusama's.
https://...
1
vote
Help configuring the democracy pallet and referenda proposal
Looks like it is in the referenda config:
/// The **minimum** amount to be used as a deposit for a public referendum proposal.
#[pallet::constant]
type SubmissionDeposit: Get<BalanceOf<Self, I&...
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 ...
1
vote
Accepted
How to get the call `authorize_upgrade` from `cumulus_pallet_parachain_system` inside another pallet?
cumulus_pallet_parachain_system::Call::<T>::authorize_upgrade { code_hash }
This gives you access in your pallet to the parachain system Call. T needs to implement ...
1
vote
How to loose couple trait with config?
Rather than making your trait generic over T: Config, you should make it generic over AccountId, and you probably should not include Origin anywhere in your interface.
Then, rather than passing Self, ...
1
vote
Accepted
Raw specs not building, unknown field
Look here:
https://github.com/Kylin-Network/kylin-collator/blob/d21e1db3511f4536cf234c30d4081da1f4ea1230/node/src/command.rs#L39
impl IdentifyChain for dyn sc_service::ChainSpec {
fn identify(&...
1
vote
Can't reach DemocracyConfig import
I think you have not implemented DemocracyConfig in runtime.
1
vote
Expose StorageItems to other pallets whose types are bound on an instance of my pallet
As far as I understand your trait approach is correct.
The only way of how Pallets are supposed to interact with each other, be it storage or calls, is through traits.
So you cannot use a storage Item ...
1
vote
Add scheduler pallet in substrate
The error is saying you have not implemented the frame_system::Config for your runtime. So you are missing some code block like:
impl frame_system::Config for Runtime {
type BaseCallFilter = ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
config × 17pallet × 9
runtime × 3
configuration × 3
traits × 3
democracy × 3
storage × 2
extrinsic × 2
error × 2
origin × 2
accountid × 2
substrate-node-template × 1
xcm × 1
cumulus × 1
rust × 1
chainspec × 1
upgrade × 1
struct × 1
runtime-upgrade × 1
signed-extensions × 1
mock × 1
tight-coupling × 1
astar × 1
multiaddress × 1
loose-coupling × 1