Skip to content

Commit 5e1e4dc

Browse files
committed
Apply suggestions
1 parent 3dac8c3 commit 5e1e4dc

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

develop/parachains/customize-parachain/add-pallet-instances.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ parameter_types! {
4444

4545
For a single instance, the configuration would look like this:
4646

47-
```rust
47+
```rust hl_lines="1"
4848
impl pallet_collective::Config for Runtime {
4949
type RuntimeOrigin = RuntimeOrigin;
5050
type Proposal = RuntimeCall;
@@ -64,7 +64,7 @@ impl pallet_collective::Config for Runtime {
6464

6565
For multiple instances, you need to create a unique identifier for each instance using the `Instance` type with a number suffix, then implement the configuration for each one:
6666

67-
```rust
67+
```rust hl_lines="2-3"
6868
// Configure first instance
6969
type Collective1 = pallet_collective::Instance1;
7070
impl pallet_collective::Config<Collective1> for Runtime {
@@ -82,7 +82,8 @@ impl pallet_collective::Config<Collective1> for Runtime {
8282
type KillOrigin = EnsureRoot<Self::AccountId>;
8383
type Consideration = ();
8484
}
85-
85+
```
86+
```rust hl_lines="2-3"
8687
// Configure second instance
8788
type Collective2 = pallet_collective::Instance2;
8889
impl pallet_collective::Config<Collective2> for Runtime {
@@ -111,7 +112,7 @@ Finally, add both pallet instances to your runtime definition, ensuring each has
111112
- A unique pallet index
112113
- The correct instance type specified
113114

114-
```rust
115+
```rust hl_lines="6-10"
115116
#[frame_support::runtime]
116117
mod runtime {
117118
#[runtime::runtime]

llms.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3109,8 +3109,8 @@ Running multiple instances of the same pallet within a runtime is a powerful tec
31093109

31103110
## Understanding Instantiable Pallets
31113111

3112-
Unlike standard pallets that exist as a single instance in a runtime, instantiable pallets require special configuration through an additional generic parameter `I`.
3113-
This generic `I` creates a unique lifetime for each pallet instance, affecting the pallet's generic types and its configuration trait `T`.
3112+
Unlike standard pallets that exist as a single instance in a runtime, instantiable pallets require special configuration through an additional [generic parameter](https://doc.rust-lang.org/reference/items/generics.html){target=\_blank} `I`.
3113+
This generic `I` creates a unique [lifetime](https://doc.rust-lang.org/rust-by-example/scope/lifetime.html){target=\_blank} for each pallet instance, affecting the pallet's generic types and its configuration trait `T`.
31143114

31153115
You can identify an instantiable pallet by examining its `Pallet` struct definition, which will include both the standard generic `T` and the instantiation generic `I`:
31163116

@@ -3142,7 +3142,7 @@ parameter_types! {
31423142

31433143
For a single instance, the configuration would look like this:
31443144

3145-
```rust
3145+
```rust hl_lines="1"
31463146
impl pallet_collective::Config for Runtime {
31473147
type RuntimeOrigin = RuntimeOrigin;
31483148
type Proposal = RuntimeCall;
@@ -3162,7 +3162,7 @@ impl pallet_collective::Config for Runtime {
31623162

31633163
For multiple instances, you need to create a unique identifier for each instance using the `Instance` type with a number suffix, then implement the configuration for each one:
31643164

3165-
```rust
3165+
```rust hl_lines="2-3"
31663166
// Configure first instance
31673167
type Collective1 = pallet_collective::Instance1;
31683168
impl pallet_collective::Config<Collective1> for Runtime {
@@ -3180,7 +3180,8 @@ impl pallet_collective::Config<Collective1> for Runtime {
31803180
type KillOrigin = EnsureRoot<Self::AccountId>;
31813181
type Consideration = ();
31823182
}
3183-
3183+
```
3184+
```rust hl_lines="2-3"
31843185
// Configure second instance
31853186
type Collective2 = pallet_collective::Instance2;
31863187
impl pallet_collective::Config<Collective2> for Runtime {
@@ -3209,7 +3210,7 @@ Finally, add both pallet instances to your runtime definition, ensuring each has
32093210
- A unique pallet index
32103211
- The correct instance type specified
32113212

3212-
```rust
3213+
```rust hl_lines="6-10"
32133214
#[frame_support::runtime]
32143215
mod runtime {
32153216
#[runtime::runtime]

0 commit comments

Comments
 (0)