17 releases (11 major breaking)
new 14.0.0 | Apr 8, 2024 |
---|---|
13.0.0 | Mar 18, 2024 |
12.0.0 | Feb 26, 2024 |
11.0.0 | Feb 13, 2024 |
0.1.0-dev.2 | Jul 27, 2023 |
#5 in #demonstrating
285 downloads per month
Used in pallet-examples
2MB
35K
SLoC
Default Config Example Pallet
An example pallet demonstrating the ability to derive default testing configs via
#[derive_impl]
and #[pallet::config(with_default)]
.
Run cargo doc --package pallet-default-config-example --open
to view this pallet's documentation.
License: MIT-0
lib.rs
:
Default Config Pallet Example
A simple example of a FRAME pallet that utilizes frame_support::derive_impl
to demonstrate
the simpler way to implement Config
trait of pallets. This example only showcases this in a
mock.rs
environment, but the same applies to a real runtime as well.
See the source code of tests
for a real examples.
Study the following types:
pallet::DefaultConfig
, and how it differs frompallet::Config
.- [
struct@pallet::config_preludes::TestDefaultConfig
] and how it implementspallet::DefaultConfig
. - Notice how
pallet::DefaultConfig
is independent offrame_system::Config
.
Dependencies
~17–31MB
~494K SLoC