Skip to main content
16 votes
Accepted

How to manually remove storage items using Sudo?

If you have access to the polkadot-js/apps UI to your chain, you can get the keys listed in the Developer -> Chain state section. Select the entry you want as well as the params and it will also ...
Jaco's user avatar
  • 5,865
4 votes
Accepted

How to enable free execution for specific extrinsics using the SkipCheckIfFeeless

This is a great question! SkipCheckIfFeeless was indeed designed as a mechanism to trigger transactions without requiring the existence of the sender's account. So, this error should be fixed at the ...
gupnik's user avatar
  • 66
4 votes
Accepted

Using `app_crypto!` `Public` type as `AccountId` in the runtime

The solution that works inside the extrinsic is the following: let who = ensure_signed(origin)?; let who: AuthorityId = sp_application_crypto::sr25519::Public::from_raw(who.into()).into(); This keeps ...
Mathis Wellmann's user avatar
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 ...
kianenigma's user avatar
  • 2,799
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. ...
kianenigma's user avatar
  • 2,799
3 votes
Accepted

Get BlockNumber from Pallet

Try this: Listings::<T>::insert( &property, &who, Listing { is_active: is_active.unwrap_or(false), content, created: frame_system::Pallet::<T>::...
Artur Gontijo's user avatar
2 votes

Mixing FRAME macros in a single runtime or pallet

It should be okay to mix pallets from the old and new macros. We had this for a while when we were migrating pallets to the new macros. End of the day, the underlying generated Rust code is the same, ...
Shawn Tabrizi's user avatar
  • 16.1k
2 votes

Question about Raw Origin in Frame System Pallet

You should review how generics work in Rust. By defining RawOrigin as pub enum RawOrigin<AccountId>, we allow this enum object to work for any generic AccountId type. What you seem to want ...
Shawn Tabrizi's user avatar
  • 16.1k
2 votes

Basics > Runtime > Core primitives > frame_system / node_primitives vs core primitives / Docu of a Pallet configuration trait

The node 'client' runs the runtime (which has all the pallets in it). The node_primitives are defined for the client rather than for the runtime. For pallets one would want to refer to frame_system ...
Squirrel's user avatar
  • 3,849
2 votes

Are pallet:constants really constant?

At the moment, Rust does not have stable support for const generics or const traits, and similar stuff. Your Pallet constants SHOULD be constant, and it is your job as a runtime developer to ensure ...
Shawn Tabrizi's user avatar
  • 16.1k
2 votes
Accepted

Reaping vs. dusting and how to whitelist an account

Are reaping and dusting separate processes? Yes, this made it clear to me: dusting: removing remaining balance (e.g. after a transfer) if it is lower than the ED. reaping: removing an account from ...
Daan van der Plas's user avatar
2 votes

DispatchError::Other(_) always being mapped to DispatchError::Other("")

Back in the old days the error was just a string, that we also did not stored on chain. Then FRAME added support for custom pallet errors. To stay compatible with th old code the Other variant was ...
bkchr's user avatar
  • 11.6k
2 votes
Accepted

How to migrate events from the frame_system pallet?

The events storage never needs to be migrated since it is cleared every block. Further, the change from Event to RuntimeEvent was just a rename (#11981) of the type.
Oliver Tale-Yazdi's user avatar
1 vote
Accepted

No way to do a runtime-upgrade after we upgraded our mainnet chain to version 0.9.31 version

I think there is still a way to do a runtime upgrade by using System::SetStorage which seems to be present in your runtime. The weight of that should be rather low and you can overwrite the :code key. ...
Oliver Tale-Yazdi's user avatar
1 vote

Are users only allowed to own 16 assets with pallet-assets?

An account can own more than 16 assets. If someone places a deposit (in DOT), inc_consumers won't be called. let reason = if let Some((depositor, deposit)) = maybe_deposit { if ...
Juan Girini's user avatar
1 vote
Accepted

Why is the max number of consumers set to 16?

Nothing in the kitchensink runtime are maximum values or anything similar. You could call these numbers reasonable default values or most of the times configurations to make it work. These values are ...
bkchr's user avatar
  • 11.6k
1 vote

How use Metadata deocde Vec::<EventRecord<Event, H256>>

Here are some very detailed examples. subscribe_all_event subscribe_one_event subscribe_some_event
AurevoirXavier's user avatar
  • 10.7k

Only top scored, non community-wiki answers of a minimum length are eligible