Questions tagged [macro]

The tag has no usage guidance.

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

Organize Runtime into modules

In the examples I've seen so far I can see that all the [pallet::*] definitions are within the #[frame_support::pallet] module. Is there any way we can split these into separate modules? For example ...
user avatar
  • 101
3 votes
0 answers
27 views

Expose StorageItems to other pallets whose types are bound on an instance of my pallet

I have a pallet pallet-a whose StorageItem should be read/written by other pallets. Let's say that StorageItem is #[pallet::storage] #[pallet::getter(fn get_commitments)] pub type Commits&...
user avatar
2 votes
1 answer
41 views

Why do runtime APIs have a block_height parameter on the client side but not on the runtime side?

Runtime APIs are declared using the decl_runtime_api! macro. This is typically in a primitives crate. For example: decl_runtime_apis! { pub trait ExampleApi { fn get_info(param1: u32, ...
user avatar
1 vote
2 answers
43 views

Problems With `app_crypto!` Macro

I have the following error while building: error[E0599]: no function or associated item named `generate_with_phrase` found for struct `crain_pow::app::Pair` in the current scope --> node/src/...
user avatar
  • 344
3 votes
1 answer
21 views

Adding PaysFee to #[pallet::weight("")] produces unexpected token error

I'm working with the node template and I want a particular type of extrinsic to not have to pay a fee. I followed these instructions but whenever I add another value to the "pallet::weight(10_000)...
user avatar
  • 31
7 votes
2 answers
66 views

What are the differences between using declarative and attribute macros in FRAME?

What's the main difference (besides the code) between using the decl_storage! macro rule and using the [pallet::storage] macro? I've seen pretty much everyone using macro rules, but on the latest ...
user avatar
  • 616
3 votes
1 answer
42 views

What is the role of `#[scale_info(skip_type_params(T))]`?

#[derive(Encode,Decode,TypeInfo) #[scale_info(skip_type_params(T))] Pub struct Asset<T:Config> { Id:### Name:## } So in the above example if you dont include the second macro. The compiler will ...
user avatar