Crate polkadot_sdk_frame

source ·
Expand description

§FRAME

  ______   ______    ________   ___ __ __   ______
 /_____/\ /_____/\  /_______/\ /__//_//_/\ /_____/\
 \::::_\/_\:::_ \ \ \::: _  \ \\::\| \| \ \\::::_\/_
  \:\/___/\\:(_) ) )_\::(_)  \ \\:.      \ \\:\/___/\
   \:::._\/ \: __ `\ \\:: __  \ \\:.\-/\  \ \\::___\/_
    \:\ \    \ \ `\ \ \\:.\ \  \ \\. \  \  \ \\:\____/\
     \_\/     \_\/ \_\/ \__\/\__\/ \__\/ \__\/ \_____\/

Framework for Runtime Aggregation of Modularized Entities: Substrate’s State Transition Function (Runtime) Framework.

§Usage

The main intended use of this crate is for it to be imported with its preludes:

#[frame::pallet]
pub mod pallet {
	use frame::prelude::*;
	// ^^ using the prelude!

	#[pallet::config]
	pub trait Config: frame_system::Config {}

	#[pallet::pallet]
	pub struct Pallet<T>(_);
}

pub mod tests {
	use frame::testing_prelude::*;
}

pub mod runtime {
	use frame::runtime::prelude::*;
}

See: prelude, testing_prelude and runtime::prelude.

Please note that this crate can only be imported as polkadot-sdk-frame or frame.

§Documentation

See polkadot_sdk::frame.

§Underlying dependencies

This crate is an amalgamation of multiple other crates that are often used together to compose a pallet. It is not necessary to use it, and it may fall short for certain purposes.

In short, this crate only re-exports types and traits from multiple sources. All of these sources are listed (and re-exported again) in deps.

§WARNING: Experimental

This crate and all of its content is experimental, and should not yet be used in production.

Re-exports§

Modules§

  • The arithmetic types used for safe math.
  • Access to all of the dependencies of this crate. In case the re-exports are not enough, this module can be used.
  • All derive macros used in frame.
  • Macros used within the main pallet macro.
  • The main prelude of FRAME.
  • Low level primitive types used in FRAME pallets.
  • All of the types and tools needed to build FRAME-based runtimes.
  • The main testing prelude of FRAME.
  • All traits often used in FRAME pallets.