Skip to main content

New answers tagged

0 votes
Accepted

Where do I find the construct_runtime macro?

Basically, the above answer is correct. Just make sure you use the same version of pallet-node-authorization with the "substrate-node-template" itself. In my case, I use the all modules as &...
Zuoyang Ding's user avatar
1 vote
Accepted

How to fix `cargo clippy` error for `#[pallet::call]` and `#[pallet::generate_deposit(pub(crate) fn deposit_event)]`

You can't fix these clippy errors locally. If you want to keep #![warn(clippy::missing_docs_in_private_items)]. Those code is generated by a macro defined in upstream. You'll need to submit a PR to ...
AurevoirXavier's user avatar
  • 10.7k
0 votes

Sudo account reward remainder

RewardRemainder need an object that implement OnUnbalanced. https://github.com/paritytech/polkadot-sdk/blob/96ab6869bafb06352b282576a6395aec8e9f2705/substrate/frame/staking/src/pallet/mod.rs#L164 We ...
AurevoirXavier's user avatar
  • 10.7k
1 vote
Accepted

how to create merkle root of given hashes inside a pallet

The following code should do it: sp_runtime::traits::BlakeTwo256::trie_root( leaves .iter() .enumerate() .map(|(i, l)| ((i as u32).encode(), l.encode())) .collect() ...
bkchr's user avatar
  • 11.6k
2 votes
Accepted

Which one is the latest release polkadot-v1.12.0 or release-polkadot-v1.12.0 or release-crates-io-v1.12.0?

crates-io-* is for crates.io. polkadot-* is a tag for release. release-* is a branch. It corresponds to that version and may include minor updates. For me, I always use release-*.
AurevoirXavier's user avatar
  • 10.7k
1 vote
Accepted

Is there a way to use a crate that depends on the `std` in substrate OCW?

I'm not sure why it was designed this way, but I understand how it works. Perhaps they intended for the OCW to run anywhere since it's part of the WASM blob. Therefore, everything is compiled into ...
AurevoirXavier's user avatar
  • 10.7k
0 votes
Accepted

Fixed Amount of Minting per block?

Yes, this is possible. The Darwinia Crab network uses such logic. We have a customized staking pallet. For your purposes, this could be any pallet that handles inflation, such as pallet-inflation or ...
AurevoirXavier's user avatar
  • 10.7k

Top 50 recent answers are included