You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,33 +57,36 @@ To add the collectibles pallet to the runtime:
54
57
default = ["std"]
55
58
std = [
56
59
...
57
-
"collectibles/std",
60
+
"collectibles/std",
61
+
"pallet-insecure-randomness-collective-flip/std",
58
62
...
59
63
```
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.
61
65
1. Save your changes.
62
66
63
67
1. Open `runtime/src/lib.rs`.
64
68
65
-
1. Import the Collectibles pallet into the runtime.
69
+
1. Import the pallets into the runtime.
66
70
67
71
```rust
72
+
pub use pallet_insecure_randomness_collective_flip;
68
73
/// Import the Collectibles pallet.
69
74
pub use collectibles;
70
75
```
71
76
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.
73
78
74
79
```rust
80
+
impl pallet_insecure_randomness_collective_flip::Config for Runtime{}
75
81
impl collectibles::Config for Runtime {
76
82
type RuntimeEvent = RuntimeEvent;
77
83
type Currency = Balances;
78
-
type CollectionRandomness = RandomnessCollectiveFlip;
84
+
type CollectionRandomness = InsecureRandomnessCollectiveFlip;
79
85
type MaximumOwned = frame_support::pallet_prelude::ConstU32<100>;
80
86
}
81
87
```
82
88
83
-
1. Add the pallet to the `construct_runtime!` macro.
89
+
1. Add the pallets to the `construct_runtime!` macro.
84
90
85
91
```rust
86
92
construct_runtime!(
@@ -91,7 +97,7 @@ To add the collectibles pallet to the runtime:
0 commit comments