Topsoil
Usage
This crate is organized into 3 stages:
- preludes:
prelude,testing_prelude,runtime::prelude,benchmarking::prelude, andweights_prelude. - domain-specific modules, like
traits,hashing,arithmeticandderive. - Accessing frame/substrate dependencies directly:
deps.
The main intended use of this crate is through preludes, which re-export most of the components
needed for pallet development. Domain-specific modules serve as a backup for organization, and
deps provides direct access to all dependencies if needed.
Example Usage
use topsoil;
Features
This crate uses a runtime feature to include all types and tools needed to build FRAME-based
runtimes. For runtime development, import it as:
topsoil = { version = "foo", features = ["runtime"] }
If you just want to build a pallet instead, import it as
topsoil = { version = "foo" }
Prelude Relationships
The preludes have overlapping imports for convenience:
testing_preludeincludespreludeandruntime::preluderuntime::preludeincludespreludebenchmarking::preludeincludesprelude
Naming
Please note that this crate can only be imported as topsoil. This is due
to compatibility matters with topsoil-core.
A typical pallet's Cargo.toml using this crate looks like:
[dependencies]
codec = { features = ["max-encoded-len"], workspace = true }
scale-info = { features = ["derive"], workspace = true }
topsoil = { workspace = true, features = ["runtime"] }
[features]
default = ["std"]
std = [
"codec/std",
"scale-info/std",
"topsoil/std",
]
runtime-benchmarks = [
"topsoil/runtime-benchmarks",
]
try-runtime = [
"topsoil/try-runtime",
]