diff --git a/content/md/en/docs/build/build-process.md b/content/md/en/docs/build/build-process.md index d69bd7cbe..7929a0727 100644 --- a/content/md/en/docs/build/build-process.md +++ b/content/md/en/docs/build/build-process.md @@ -138,6 +138,6 @@ This option is primarily used for faster compile time when you don't need to upd ## Where to go next -- [Wasm-builder README](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/utils/wasm-builder/README.md) +- [Wasm-builder source](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/utils/wasm-builder/src/lib.rs) - [Rust compilation options](https://doc.rust-lang.org/cargo/commands/cargo-build.html#compilation-options) - [Discussion: Removing the native runtime](https://github.com/paritytech/substrate/issues/10579) diff --git a/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md b/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md index 62b80801a..197db12f0 100644 --- a/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md +++ b/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md @@ -119,10 +119,18 @@ Therefore, the first step is to remove some files and content from the files in #[pallet::storage] // <-- Step 5. code block will replace this. #[pallet::call] // <-- Step 6. code block will replace this. } + + pub mod weights { + // Placeholder struct for the pallet weights + pub struct SubstrateWeight(core::marker::PhantomData); + } ``` You now have a framework that includes placeholders for _events_, _errors_, _storage_, and _callable functions_. + > NOTE: Pallet weights are outside the scope of this tutorial. If you want to learn more about weights, you can read our documentation [here](/reference/how-to-guides/weights/). + + 1. Save your changes. ## Configure the pallet to emit events @@ -143,6 +151,9 @@ To define the `Config` trait for the proof-of-existence pallet: pub trait Config: frame_system::Config { /// Because this pallet emits events, it depends on the runtime's definition of an event. type RuntimeEvent: From> + IsType<::RuntimeEvent>; + /// Pallets use weights to measure the complexity of the callable functions. + /// Configuring weights is outside the scope of this tutorial, so we will leave it empty for now. + type WeightInfo; } ``` @@ -302,7 +313,7 @@ To implement this logic in the proof-of-existence pallet: 1. Save your changes and close the file. -1. Check that your code compiles by running the following command: +1. Check that your pallet compiles by running the following command: ```bash cargo check -p pallet-template