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
Changes from 4 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
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