Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Proof of Existence Fixes #2111

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/md/en/docs/build/build-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(core::marker::PhantomData<T>);
}
```

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
Expand All @@ -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<Event<Self>> + IsType<<Self as frame_system::Config>::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;
}
```

Expand Down Expand Up @@ -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
Expand Down