Expand description

The main testing prelude of FRAME.

A test setup typically starts with:

use polkadot_sdk_frame::testing_prelude::*;
// rest of your test setup.

Re-exports§

Macros§

  • Other helper macros from frame_support that help with asserting in tests. Assert an expression returns an error specified.
  • Other helper macros from frame_support that help with asserting in tests. Assert an expression returns an error specified.
  • Other helper macros from frame_support that 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_support that help with asserting in tests. Evaluate an expression, assert it returns an expected Err value and that runtime storage has not been mutated (i.e. expression is a no-operation).
  • Other helper macros from frame_support that help with asserting in tests. Panic if an expression doesn’t evaluate to Ok.
  • Other helper macros from frame_support that 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 std feature is enabled.

Type Aliases§

  • An implementation of sp_runtime::traits::Block to be used in tests.
  • An implementation of sp_runtime::traits::Block to be used in tests with u32 BlockNumber type.
  • An implementation of sp_runtime::traits::Block to 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_support that help with asserting in tests.