Module frame::testing_prelude
source · Expand description
The main testing prelude of FRAME.
A test setup typically starts with:
use frame::testing_prelude::*;
// rest of your test setup.Re-exports
pub use frame_system;pub use super::prelude::*;pub use super::runtime::testing_prelude::*;
Macros
- Other helper macros from
frame_supportthat help with asserting in tests. Assert an expression returns an error specified. - Other helper macros from
frame_supportthat help with asserting in tests. Assert an expression returns an error specified. - Other helper macros from
frame_supportthat help with asserting in tests. Assert that the maximum encoding size does not exceed the value defined in [MAX_MODULE_ERROR_ENCODED_SIZE] during compilation. - Other helper macros from
frame_supportthat help with asserting in tests. Evaluate an expression, assert it returns an expectedErrvalue and that runtime storage has not been mutated (i.e. expression is a no-operation). - Other helper macros from
frame_supportthat help with asserting in tests. Panic if an expression doesn’t evaluate toOk. - Other helper macros from
frame_supportthat help with asserting in tests. Evaluate any expression and assert that runtime storage has not been mutated (i.e. expression is a storage no-operation). - Feature gate some code that should only be run when
stdfeature is enabled.
Type Definitions
- An implementation of
sp_runtime::traits::Blockto be used in tests. - An implementation of
sp_runtime::traits::Blockto be used in tests with u32 BlockNumber type. - An implementation of
sp_runtime::traits::Blockto be used in tests with u128 BlockNumber type. - An unchecked extrinsic type to be used in tests.
- Type alias for Externalities implementation used in tests.
Attribute Macros
- Other helper macros from
frame_supportthat help with asserting in tests.