Skip to content
Open
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
891 changes: 548 additions & 343 deletions .ai/categories/parachains.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ This command validates all pallet configurations and prepares the build for depl
## Run Your Chain Locally
Launch your parachain locally to test the new pallet functionality using the [Polkadot Omni Node](https://crates.io/crates/polkadot-omni-node){target=\_blank}.
Launch your parachain locally to test the new pallet functionality using the [Polkadot Omni Node](https://crates.io/crates/polkadot-omni-node){target=\_blank}. For instructions on setting up the Polkadot Omni Node and [Polkadot Chain Spec Builder](https://crates.io/crates/staging-chain-spec-builder){target=\_blank}, refer to the [Set Up a Parachain Template](/parachains/launch-a-parachain/set-up-the-parachain-template/){target=\_blank} guide.
### Generate a Chain Specification
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Pallet Testing
title: Unit Test Pallets
description: Learn how to efficiently test pallets in the Polkadot SDK, ensuring the reliability and security of your pallets operations.
categories: Parachains
url: https://docs.polkadot.com/parachains/customize-runtime/pallet-development/pallet-testing/
---

# Pallet Testing
# Unit Test Pallets

## Introduction

Expand Down
117 changes: 81 additions & 36 deletions .ai/site-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2142,14 +2142,14 @@
},
{
"id": "parachains-customize-runtime-pallet-development-benchmark-pallet",
"title": "Benchmarking FRAME Pallets",
"title": "Benchmark Your Pallet",
"slug": "parachains-customize-runtime-pallet-development-benchmark-pallet",
"categories": [
"Parachains"
],
"raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/parachains-customize-runtime-pallet-development-benchmark-pallet.md",
"html_url": "https://docs.polkadot.com/parachains/customize-runtime/pallet-development/benchmark-pallet/",
"preview": "Benchmarking is a critical component of developing efficient and secure blockchain runtimes. In the Polkadot ecosystem, accurately benchmarking your custom pallets ensures that each extrinsic has a precise [weight](/reference/glossary/#weight){target=\\_blank}, representing its computational and storage demands. This process is vital for maintaining the blockchain's performance and preventing potential vulnerabilities, such as Denial of Service (DoS) attacks.",
"preview": "Benchmarking is the process of measuring the computational resources (execution time and storage) required by your pallet's extrinsics. Accurate [weight](https://paritytech.github.io/polkadot-sdk/master/frame_support/weights/index.html){target=\\_blank} calculations are essential for ensuring your blockchain can process transactions efficiently while protecting against denial-of-service attacks.",
"outline": [
{
"depth": 2,
Expand All @@ -2158,52 +2158,97 @@
},
{
"depth": 2,
"title": "The Case for Benchmarking",
"anchor": "the-case-for-benchmarking"
"title": "Prerequisites",
"anchor": "prerequisites"
},
{
"depth": 3,
"title": "Benchmarking and Weight",
"anchor": "benchmarking-and-weight"
"depth": 2,
"title": "Create the Benchmarking Module",
"anchor": "create-the-benchmarking-module"
},
{
"depth": 2,
"title": "Benchmarking Process",
"anchor": "benchmarking-process"
"title": "Define the Weight Trait",
"anchor": "define-the-weight-trait"
},
{
"depth": 3,
"title": "Prepare Your Environment",
"anchor": "prepare-your-environment"
"depth": 2,
"title": "Add WeightInfo to Config",
"anchor": "add-weightinfo-to-config"
},
{
"depth": 3,
"title": "Write Benchmark Tests",
"anchor": "write-benchmark-tests"
"depth": 2,
"title": "Update Extrinsic Weight Annotations",
"anchor": "update-extrinsic-weight-annotations"
},
{
"depth": 3,
"title": "Add Benchmarks to Runtime",
"anchor": "add-benchmarks-to-runtime"
"depth": 2,
"title": "Include the Benchmarking Module",
"anchor": "include-the-benchmarking-module"
},
{
"depth": 3,
"title": "Run Benchmarks",
"anchor": "run-benchmarks"
"depth": 2,
"title": "Configure Pallet Dependencies",
"anchor": "configure-pallet-dependencies"
},
{
"depth": 2,
"title": "Where to Go Next",
"anchor": "where-to-go-next"
"title": "Update Mock Runtime",
"anchor": "update-mock-runtime"
},
{
"depth": 2,
"title": "Configure Runtime Benchmarking",
"anchor": "configure-runtime-benchmarking"
},
{
"depth": 2,
"title": "Test Benchmark Compilation",
"anchor": "test-benchmark-compilation"
},
{
"depth": 2,
"title": "Build the Runtime with Benchmarks",
"anchor": "build-the-runtime-with-benchmarks"
},
{
"depth": 2,
"title": "Install the Benchmarking Tool",
"anchor": "install-the-benchmarking-tool"
},
{
"depth": 2,
"title": "Download the Weight Template",
"anchor": "download-the-weight-template"
},
{
"depth": 2,
"title": "Execute Benchmarks",
"anchor": "execute-benchmarks"
},
{
"depth": 2,
"title": "Use Generated Weights",
"anchor": "use-generated-weights"
},
{
"depth": 2,
"title": "Run Your Chain Locally",
"anchor": "run-your-chain-locally"
},
{
"depth": 2,
"title": "Related Resources",
"anchor": "related-resources"
}
],
"stats": {
"chars": 14715,
"words": 1879,
"headings": 9,
"estimated_token_count_total": 3338
"chars": 22752,
"words": 2813,
"headings": 18,
"estimated_token_count_total": 5191
},
"hash": "sha256:915bc91edd56cdedd516e871dbe450d70c9f99fb467cc00ff231ea3a74f61d96",
"hash": "sha256:c1b53ecbfc3dea02097104c7a4c652e61ccc42ad56325a9c80684850a198fbdd",
"token_estimator": "heuristic-v1"
},
{
Expand Down Expand Up @@ -2349,12 +2394,12 @@
}
],
"stats": {
"chars": 26671,
"words": 3041,
"chars": 26958,
"words": 3085,
"headings": 26,
"estimated_token_count_total": 6113
"estimated_token_count_total": 6194
},
"hash": "sha256:607e283aaa1295de0af191d97de7f6f87afb722c601a447821fde6a09b97f1af",
"hash": "sha256:dad68ea59fd05fd60dc8890c4cf5615243c7ea879830b0dcf3a5e5e53c3ccec7",
"token_estimator": "heuristic-v1"
},
{
Expand Down Expand Up @@ -2445,7 +2490,7 @@
},
{
"id": "parachains-customize-runtime-pallet-development-pallet-testing",
"title": "Pallet Testing",
"title": "Unit Test Pallets",
"slug": "parachains-customize-runtime-pallet-development-pallet-testing",
"categories": [
"Parachains"
Expand Down Expand Up @@ -2491,12 +2536,12 @@
}
],
"stats": {
"chars": 6892,
"words": 911,
"chars": 6895,
"words": 912,
"headings": 7,
"estimated_token_count_total": 1563
},
"hash": "sha256:8568dfa238b9a649a4e6e60510625c2e7879b76a93187b0b8b8dccf6bc467ae6",
"hash": "sha256:041ccd82f0c1ddfb93be05feb6cf9d7d4a7e37af6caa8fa8fdab5d5538017122",
"token_estimator": "heuristic-v1"
},
{
Expand Down
Loading
Loading