20 releases (major breaking)
17.0.0 | Jun 21, 2024 |
---|---|
16.0.0 | May 23, 2024 |
15.0.0 | Apr 30, 2024 |
14.0.0 | Apr 8, 2024 |
0.1.0-dev.2 | Jul 27, 2023 |
#8 in #demonstrating
1,225 downloads per month
Used in pallet-examples
2MB
36K
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–33MB
~521K SLoC