Skip to main content

Questions tagged [pallet]

Questions about Runtime Modules built with the FRAME developer SDK.

Filter by
Sorted by
Tagged with
0 votes
1 answer
13 views

BlockNumber is no more availabe on frame_system [duplicate]

I updated my code to polkadot-v1.6.0, its now gives error: error[E0576]: cannot find associated type `BlockNumber` in trait `frame_system::Config` --> pallets/support/src/lib.rs:22:31 | 22 | ...
Amiya Behera's user avatar
1 vote
1 answer
31 views

What's the correct way to add a new pallet to a live runtime?

Aside from the obvious, configuring the pallet and adding it to the construct_runtime! invocation, what else needs to be done that isn't mentioned in the substrate tutorials? For example, it's also ...
mkl's user avatar
  • 432
2 votes
1 answer
40 views

How to access functions of pallet-assets from custom pallet?

I want to use the functions of pallet-asset like decrease_balance and Assets storage in our custom pallet. How I can perform this operation? Thanks
Vitthal agarwal's user avatar
1 vote
1 answer
20 views

How to integrate pallet-asset?

I want to integrate pallet-asset into the substrate-node-template. What all other pallets need to integrate with pallet-asset to get assets functionalities? Thanks
Vitthal agarwal's user avatar
0 votes
0 answers
15 views

Randomness in substrate pallets

We are creating a price guessing game as a substrate pallet. We would like to fetch random objects from an API for the game. What options can we use to get randomness within our pallet?
René Hürter's user avatar
1 vote
1 answer
17 views

How to create a 60 seconds timer in a pallet

we are creating a game which give the player a 60 seconds rounds to play. How can we set a timer of 60 seconds in a substrate pallet?
René Hürter's user avatar
0 votes
2 answers
45 views

Build Error with `tikv-jemalloc-sys v0.5.4+5.3.0-patched` in Substrate Node Template

I am encountering a build error when running cargo build --release on a Substrate Node Template project. Here is the error message: error: failed to run custom build command for `tikv-jemalloc-sys v0....
Humayun Ahmad Rajib's user avatar
0 votes
0 answers
23 views

Can't compose_call with call function limited_reserve_transfer_assets - python substrate interface?

This question relates to building the call_params for the compose_call function. I have the params for the rest correct, but have trouble building the assets attribute params? Here's a reference I ...
ConfusedSubstrateNoob's user avatar
1 vote
3 answers
38 views

Is it possible for users to call non #[pallet::call_index(0)] functions

Is this possible? Say you have a function in a pallet outside of the lib.rs file that is a function like: impl<T: Config> Pallet<T> { pub fn tester(block: u64) { StorageElement::<...
Bob Linux's user avatar
  • 113
0 votes
1 answer
21 views

Dynamic function weights

Are dynamic weights possible to implement? When running benchmarks, the weights are returned. But there are parameters that are updateable while the blockchain is running and within on_initialize the ...
Bob Linux's user avatar
  • 113
1 vote
1 answer
35 views

Conflicting `Encode` and `Decode` Trait Implementations for Type Aliases in a custom pallet

I'm working on a custom pallet related to the zero-knowledge proof system and I've run into an issue regarding the trait implementations. I have defined a fixed-size hash type H256 using a custom ...
Discardo's user avatar
  • 436
0 votes
1 answer
28 views

Create Custom coin using pallet_balance of Substrate

So a Quick Question ? I am having trouble customizing the existing pallet_balance to create a new crypto coin in my own image .I am using Substrate-Node-Template.
Md. Raisul Islam Rony's user avatar
1 vote
1 answer
39 views

Is it true that the entire substrate docs points to an archived repo?

The substrate docs are supposed to guide users through the substrate SDK via tutorials. These tutorials use exclusively (to my knowledge) the substrate node template repository. However, all the ...
Marlo's user avatar
  • 111
3 votes
1 answer
33 views

chain stop producing block after adding pallet-session

I'm working on the pow substrate chain with grandpa. For that I integrate the pallet-session and substrate-validator-set[https://github.com/gautamdhameja/substrate-validator-set/tree/master] to join ...
Deepak Chaudhary's user avatar
0 votes
1 answer
49 views

IEEE 754 Floating Point Numbers wasm impelementation

We are looking to enable reproducible floating point operations on chain by implementing the IEEE 754 standard as an on-chain wasm function. As discussed in this stackoverflow post, substrate does not ...
Mathis Wellmann's user avatar
1 vote
0 answers
44 views

How to access keystore from pallet?

I want to add keys from a pallet in the keystore so that these keys can participate in the consensus[validation/block authorisation]. Is it possible to perform? If yes how?
Vitthal agarwal's user avatar
0 votes
0 answers
52 views

How to mutate a Vec<u16> in a struct in a DoubleStorageMap?

How do I mutate a DoubleStorageMap with a Vec<T::AccountId> as a value using a struct? Data::<T>::mutate( id.clone(), user_id.clone(), |params: &mut DataParams<T::AccountId>...
bobby dy's user avatar
0 votes
0 answers
54 views

Is it possible to fetch the validator's public address who participate during the grandpa finality of the current block?[updated]

I'm working on a chain where I need to gather the validator's public address who participates in the grandpa finality process and validate the current block. For ex: let's say we have 10 validators ...
Deepak Chaudhary's user avatar
1 vote
2 answers
79 views

How to add block author through InherentDataProvider in pow consensus?

I'm working on pow consensus chain and want to fetch block author in a pallet. I'm following Academy-PoW repo for adding block author through InherentDataProvider. But here default is passed in-place ...
Vitthal agarwal's user avatar
2 votes
3 answers
110 views

Error Bad origin on custom XCM integration

I am building custom XCM pallet. While executing specific call: The destination is of ParaId type. match send_xcm::<T::XcmSender>( (Parent, Junction::Parachain(destination.into()...
Dudo's user avatar
  • 21
2 votes
1 answer
35 views

How to make a fn only callable by an offchain worker?

I don't think this is possible but is it? I have data that comes from an API that ultimately needs to be stored onchain which I don't want to risk having done through a Pays::No fn in case the call ...
bobby dy's user avatar
2 votes
1 answer
57 views

How to update the pallet's storage from the runtime api?

Is it possible to update the storage of pallets through runtime api? Is yes. Do we have any resources for this same?
Deepak Chaudhary's user avatar
3 votes
0 answers
25 views

Difficulty Storing Consensus-Derived Value in Storage: Observing Value in Pallet Log but Not in Storage

I'm trying to store a value obtained from the consensus, specifically sc_consensus_babe::fn import_block. While I can observe the value in the pallet through the log, it doesn't seem to be stored in ...
Deepak Chaudhary's user avatar
2 votes
0 answers
31 views

How to convert AccountId from [hexadecimal, SS58Check]?[Updated]

I have two 2 storage in the pallet : #[pallet::storage] #[pallet::getter(fn subscriber)] pub type Subscriber<T:Config> = StorageValue<_, BoundedVec<T::AccountId, T::...
Deepak Chaudhary's user avatar
-1 votes
1 answer
106 views

cannot find module 'sys' and ^^^ use of undeclared crate or module `imp`

I have this error. Please check out the code at https://github.com/nhathuyenqt/pos-node error: failed to run custom build command for `node-template-runtime v4.0.0-dev (/Users/h/Desktop/pokadot/pos-...
MinhK's user avatar
  • 125
1 vote
1 answer
24 views

Is it possible to define a storage inside the pallet without config trait?

Actually I want to define a storage without config trait but if I'm doing this then I'm getting lot of error. Is it possible? /// Author of current block. #[pallet::storage] pub type Author<...
Deepak Chaudhary's user avatar
0 votes
0 answers
25 views

Whitelisted keys when benchmarking extrinsic calls

There are a few storage keys that are always whitelisted before each benchmarking pallet extrinsic call (:transaction_level, :extrinsic_index, and :intrablock_entropy), apart from the whitelisted keys ...
lime's user avatar
  • 121
0 votes
0 answers
23 views

When i built my custom pallet i got this error

#! [cfg_attr(not(feature = "std"), no_std)] // Re-export pallet items so that they can be accessed from the crate namespace. pub use pallet::*; #[frame_support::pallet] pub mod pallet { use ...
Preethi M's user avatar
1 vote
1 answer
42 views

Modifying / extending existing substrate pallet without cloning full source

I would like to modify the substrate transaction-payment pallet's CurrencyAdapter without cloning the entire crate into the local pallets. What's the best practice to provide another implementation ...
Rehan's user avatar
  • 167
1 vote
1 answer
38 views

query storage to front-end

In the pallet-template, I have this storage: #[pallet::storage] #[pallet::getter(fn getscoreboard)] pub(super) type ScoreBoard<T: Config> = StorageMap <_, Twox64Concat, T::...
MinhK's user avatar
  • 125
1 vote
1 answer
36 views

Mutual value among pallets

How to access value X in pallet A from another pallet? For example, I saw a few pallets define type Currency = Balance, is it truly the value Balance in pallet_balances? If not, how to define a ...
MinhK's user avatar
  • 125
1 vote
1 answer
19 views

How to store and query the raw text?

I want to query the task from storage. Here is the Task struct and StorageMap #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen, Default)] #[scale_info(...
MinhK's user avatar
  • 125
1 vote
1 answer
42 views

How to capture a tranfer event in oninitialize hook?

I have a custom pallet and i need to caputre and store all the transfer performed by root origin account. How can i implement it? An idea i thought was capture the transfer event on oninitalize hook ...
sachin murali's user avatar
0 votes
0 answers
46 views

How to call a contract from pallet with specific interface

I'm trying to use Ink as a programmable hook for my pallet. TD;LR; My pallet will store Agreement. struct Agreement<T> { // ... pub on_approve: T::AccountId // this point to an Ink contract }...
jasl's user avatar
  • 31
1 vote
1 answer
30 views

How to manage multiple balances for one account?

Here is my scenario: One account will maintain 3 balances of Token A, Token B, Token C. When Alice sends x Token A to Bob, it should deposit to Bob's balance for the same kind of token, means Token A. ...
MinhK's user avatar
  • 125
2 votes
1 answer
27 views

Difference Between Using Preimage Pallet and Hash Storage with T::Hashing in Substrate

I'm working on a project using Substrate and have encountered a technical question regarding data storage. I would like to understand the fundamental difference between using the Preimage pallet and ...
SailorSnoW's user avatar
1 vote
0 answers
31 views

Get weights data from a benchmarked pallet

Is there a way to get some informations for an already benchmarked pallet on the weights like the minimum and maximum weights that can be used for a function (worst case/best case) ?
SailorSnoW's user avatar
0 votes
0 answers
24 views

How to interact between a smart contract written in Solidity from substrate pallet?

Can it be possible to interact solidity smart contract from substrate pallet?
Ganesh11's user avatar
  • 1,241
1 vote
1 answer
39 views

BlockNumber and Balance Arithmetic

I am implementing subscriptions, paid for with balance, rated per block, and the duration measured in block numbers. I am finding it very difficult, in general, to perform arithmetic that take both ...
rvalle's user avatar
  • 45
1 vote
1 answer
23 views

Ensure that a call is dispatched from a specific pallet

So I want my instance of the pallet membership to be managed only by a specific pallet, and not even the Root origin. Is there anyway to create an EnsureOrigin object that can verify that a specific ...
SailorSnoW's user avatar
0 votes
1 answer
38 views

Weight consumed inside the on_idle hook?

The documentation of the on_idle hook states that "Any implementation should always respect _remaining_weight and never consume (and therefore return) more than this amount." In the ...
Benjamin Gallois's user avatar
2 votes
2 answers
110 views

Utility pallet: What are the key differences between batch batch_all and force_batch

In this question, and this answer the difference between batch and batch_all are discussed, but there is a third similar function in the utility pallet force_batch What are the key differences between ...
Simson's user avatar
  • 1,211
3 votes
2 answers
46 views

How To Remove The Sudo Pallet Safely

We have the sudo pallet on a running live mainnet. It is almost time to remove it. What is the safest way to remove it in the code? We have made code upgrades before but removing a pallet (especially ...
KathrynColleen's user avatar
1 vote
0 answers
19 views

Add a `StorageMap` to a pallet (metadata) from outside the pallet

my problem is the following: There is a pallet which contains some storage, some extrinsics, and a type in its Config implementing trait CustomPalletHooks to which it delegates some logic. Assuming ...
Antonio Antonino's user avatar
1 vote
1 answer
81 views

Contribute a pallet I've written to Polkadot Relay Chain

is there a submission procedure for contributing a pallet I've written to Polkadot, for the relay chain? I would appreciate any help with this.
Emmanuel Ngubo's user avatar
1 vote
0 answers
27 views

Run benchmark fail test in pallet-evm

test_benchmarks fail Repo: https://github.com/paritytech/frontier Command: cargo t -p pallet-evm --features runtime-benchmarks Issue: failures: ---- benchmarking::benchmark_tests::test_benchmarks ...
CocDap's user avatar
  • 678
4 votes
1 answer
43 views

How we can get the current block author account id in POA solochain?

I am working on a solochain I want to pass the account of the block author in a pallet config in runtime of the chain. How can i get the the account is of the current block author?
Ajit's user avatar
  • 827
2 votes
0 answers
17 views

How can I mint new token from ink smart contract calling pallet-balances function?

How can I mint a new native token (not a custom token) from the ink smart contract calling one of the functions from pallet-balances pallet?
Tahlil's user avatar
  • 341
0 votes
1 answer
60 views

Error: duplicate lang item in crate `sp_io` (which `sp_application_crypto` depends on): `panic_impl`

I am building a solo chain from Substrate node template, I have made some changes to switch from PoA to PoS just like this repo. Now, I am trying to add pallet-contracts on the runtime. I added the ...
Tahlil's user avatar
  • 341
1 vote
2 answers
91 views

How to add pallet contract for polkadot-v1.0.0?

How to add pallet contract for polkadot-v1.0.0? Do I only need to change the node/runtime folder or the runtime folder at root or both?
Tahlil's user avatar
  • 341

1
2 3 4 5
9