Skip to content

Commit 8968814

Browse files
committed
Updated content/md/en/tutorials/collectibles-workshop/08
1 parent 1a4c24f commit 8968814

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

content/md/en/docs/tutorials/collectibles-workshop/08-add-collectibles-to-runtime.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ To add the collectibles pallet to the runtime:
4646
For example:
4747

4848
```toml
49+
...
50+
pallet-insecure-randomness-collective-flip = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
51+
...
4952
# Local Dependencies
5053
pallet-template = { version = "4.0.0-dev", default-features = false, path = "../pallets/template" }
5154
collectibles = { default-features = false, path = "../pallets/collectibles" }
@@ -54,33 +57,36 @@ To add the collectibles pallet to the runtime:
5457
default = ["std"]
5558
std = [
5659
...
57-
"collectibles/std",
60+
"collectibles/std",
61+
"pallet-insecure-randomness-collective-flip/std",
5862
...
5963
```
60-
64+
Note we've also included the insecure-randomness-collective-flip pallet. We'll use this pallet to generate the random values needed for the CollectionRandomness type of the collectibles pallet. It's discouraged to use this pallet in a production environment, though we can include it in this workshop for learning purposes.
6165
1. Save your changes.
6266

6367
1. Open `runtime/src/lib.rs`.
6468

65-
1. Import the Collectibles pallet into the runtime.
69+
1. Import the pallets into the runtime.
6670

6771
```rust
72+
pub use pallet_insecure_randomness_collective_flip;
6873
/// Import the Collectibles pallet.
6974
pub use collectibles;
7075
```
7176

72-
1. Implement the configuration trait for the collectibles pallet.
77+
1. Implement the configuration trait for the collectibles pallet and the insecure_randomness_collective_flip pallet.
7378

7479
```rust
80+
impl pallet_insecure_randomness_collective_flip::Config for Runtime{}
7581
impl collectibles::Config for Runtime {
7682
type RuntimeEvent = RuntimeEvent;
7783
type Currency = Balances;
78-
type CollectionRandomness = RandomnessCollectiveFlip;
84+
type CollectionRandomness = InsecureRandomnessCollectiveFlip;
7985
type MaximumOwned = frame_support::pallet_prelude::ConstU32<100>;
8086
}
8187
```
8288

83-
1. Add the pallet to the `construct_runtime!` macro.
89+
1. Add the pallets to the `construct_runtime!` macro.
8490

8591
```rust
8692
construct_runtime!(
@@ -91,7 +97,7 @@ To add the collectibles pallet to the runtime:
9197
UncheckedExtrinsic = UncheckedExtrinsic,
9298
{
9399
System: frame_system,
94-
RandomnessCollectiveFlip: pallet_randomness_collective_flip,
100+
InsecureRandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip,
95101
Timestamp: pallet_timestamp,
96102
Aura: pallet_aura,
97103
Grandpa: pallet_grandpa,

0 commit comments

Comments
 (0)