Expand description
Primitives for the runtime modules.
Modules§
- transaction_
extension - The transaction extension trait.
Macros§
- parameter_
types - Create new implementations of the
Gettrait.
Structs§
- Account
IdLookup - A lookup implementation returning the
AccountIdfrom aMultiAddress. - Append
Zeros Input - Input that adds infinite number of zero after wrapped input.
- BadOrigin
- An error type that indicates that the origin is invalid.
- Blake
Two256 - Blake2-256 Hash implementation.
- Checked
Reduce By - A
TryMorphimplementation to reduce a scalar by a particular amount, checking for underflow. - Const
Bool - Const getter for a basic type.
- ConstI8
- Const getter for a basic type.
- Const
I16 - Const getter for a basic type.
- Const
I32 - Const getter for a basic type.
- Const
I64 - Const getter for a basic type.
- Const
I128 - Const getter for a basic type.
- Const
Int - Const getter for signed integers.
- ConstU8
- Const getter for a basic type.
- Const
U16 - Const getter for a basic type.
- Const
U32 - Const getter for a basic type.
- Const
U64 - Const getter for a basic type.
- Const
U128 - Const getter for a basic type.
- Const
Uint - Const getter for unsigned integers.
- Convert
Into - A structure that performs standard conversion using the standard Rust conversion traits.
- Convert
ToValue - Adapter which turns a Get implementation into a Convert implementation which always returns in the same value no matter the input.
- Fake
Dispatchable - Dispatchable impl containing an arbitrary value which panics if it actually is dispatched.
- GetDefault
- Implement Get by returning Default for any type that implements Default.
- Identity
- A structure that performs identity conversion.
- Identity
Lookup - A lookup implementation returning the input value.
- Implication
Parts - The implication in a transaction.
- Keccak256
- Keccak-256 Hash implementation.
- Lookup
Error - An error that indicates that a lookup failed.
- Morph
Into - Implementation of
Morphwhich converts between types usingInto. - Morph
With Upper Limit - A
TryMorphimplementation to enforce an upper limit for a result of the outer morphed type. - Phantom
Data - Zero-sized type used to mark things that “act like” they own a
T. - Reduce
By - Mutator which reduces a scalar by a particular amount.
- Replace
- Morpher to disregard the source value and replace with another.
- Replace
With Default - Morpher to disregard the source value and replace with the default of
V. - Take
First - Implementation of
Morphto retrieve just the first element of a tuple. - Trailing
Zero Input - Input that adds infinite number of zero after wrapped input.
- Transaction
Extension Metadata - Information about a
TransactionExtensionfor the runtime metadata. - TryConvert
Into - A structure that performs standard conversion using the standard Rust conversion traits.
- TryMorph
Into - Implementation of
TryMorphwhich attempts to convert between types usingTryInto. - TxBase
Implication - The base implication in a transaction.
Traits§
- Account
IdConversion - This type can be converted into and possibly from an AccountId (which itself is generic).
- AppVerify
- Means of signature verification of an application key.
- Applyable
- An “executable” piece of information, used by the standard Substrate Executive in order to enact a piece of extrinsic information by marshalling and dispatching to a named function call.
- AsSystem
Origin Signer - Runtime Origin which includes a System Origin variant whose
AccountIdis the parameter. - AsTransaction
Authorized Origin - Interface to differentiate between Runtime Origins authorized to include a transaction into the block and dispatch it, and those who aren’t.
- AtLeast32
Bit - A meta trait for arithmetic.
- AtLeast32
BitUnsigned - A meta trait for arithmetic. Same as
AtLeast32Bit, but also bounded to be unsigned. - Blind
Checkable - A “checkable” piece of information, used by the standard Substrate Executive in order to check the validity of a piece of extrinsic information, usually by verifying the signature. Implement for pieces of information that don’t require additional context in order to be checked.
- Block
- Something which fulfills the abstract idea of a Substrate block. It has types for
Extrinsicpieces of information as well as aHeader. - Block
IdTo - Something that can convert a
BlockIdto a number or a hash. - Block
Number - Super trait with all the attributes for a block number.
- Block
Number Provider - Get current block number
- Bounded
- Numbers which have upper and lower bounds
- Check
Equal - Something that can be checked for equality and printed out to a debug channel if bad.
- Checkable
- Extract the digest type for a block.
A “checkable” piece of information, used by the standard Substrate Executive in order to
check the validity of a piece of extrinsic information, usually by verifying the signature.
Implement for pieces of information that require some additional context
Contextin order to be checked. - Checked
Add - Performs addition that returns
Noneinstead of wrapping around on overflow. - Checked
Conversion - Convenience type to work around the highly unergonomic syntax needed
to invoke the functions of overloaded generic traits, in this case
TryFromandTryInto. - Checked
Div - Performs division that returns
Noneinstead of panicking on division by zero and instead of wrapping around on underflow and overflow. - Checked
Mul - Performs multiplication that returns
Noneinstead of wrapping around on underflow or overflow. - Checked
Shl - Performs a left shift that returns
Noneon shifts larger than or equal to the type width. - Checked
Shr - Performs a right shift that returns
Noneon shifts larger than or equal to the type width. - Checked
Sub - Performs subtraction that returns
Noneinstead of wrapping around on underflow. - Clear
- Trait for things that can be clear (have no bits set). For numeric types, essentially the same
as
Zero. - Convert
- Infallible conversion trait. Generic over both source and destination types.
- Convert
Back - Reversing infallible conversion trait. Generic over both source and destination types.
- Debug
?formatting.- Dispatch
Transaction - Single-function utility trait with a blanket impl over
TransactionExtensionin order to provide transaction dispatching functionality. We avoid implementing this directly on the trait since we never want it to be overriden by the trait implementation. - Dispatchable
- A lazy call (module function and argument values) that can be executed via its
dispatchmethod. - Ensure
- Ensure
Add - Performs addition that returns
ArithmeticErrorinstead of wrapping around on overflow. - Ensure
AddAssign - Performs self addition that returns
ArithmeticErrorinstead of wrapping around on overflow. - Ensure
Div - Performs division that returns
ArithmeticErrorinstead of wrapping around on overflow. - Ensure
DivAssign - Performs self division that returns
ArithmeticErrorinstead of wrapping around on overflow. - Ensure
Fixed Point Number - Extends
FixedPointNumberwith the Ensure family functions. - Ensure
From - Similar to
TryFrombut returning anArithmeticErrorerror. - Ensure
Into - Similar to
TryIntobut returning anArithmeticErrorerror. - Ensure
Mul - Performs multiplication that returns
ArithmeticErrorinstead of wrapping around on overflow. - Ensure
MulAssign - Performs self multiplication that returns
ArithmeticErrorinstead of wrapping around on overflow. - Ensure
Op - Meta trait that supports all immutable arithmetic
Ensure*operations - Ensure
OpAssign - Meta trait that supports all assigned arithmetic
Ensure*operations - Ensure
Sub - Performs subtraction that returns
ArithmeticErrorinstead of wrapping around on underflow. - Ensure
SubAssign - Performs self subtraction that returns
ArithmeticErrorinstead of wrapping around on underflow. - Extension
Post Dispatch Weight Handler - A type that can handle weight refunds and incorporate extension weights into the call weight after dispatch.
- Extrinsic
Deprecated - Something that acts like an
Extrinsic. - Extrinsic
Call - An extrinsic on which we can get access to call.
- Extrinsic
Like - Something that acts like an
Extrinsic. - Extrinsic
Metadata - Implementor is an
Extrinsicand provides metadata about this extrinsic. - Get
- A trait for querying a single value from a type.
- GetNode
Block Type - A marker trait for something that knows the type of the node block.
- GetRuntime
Block Type - A marker trait for something that knows the type of the runtime block.
- Hash
- Abstraction around hashing
- Hash
Output - Super trait with all the attributes for a hashing output.
- Header
- Something which fulfills the abstract idea of a Substrate header. It has types for a
Number, aHashand aHashing. It provides access to anextrinsics_root,state_rootandparent_hash, as well as adigestand a blocknumber. - Identify
Account - Some type that is able to be collapsed into an account ID. It is not possible to recreate the original value from the account ID.
- Implication
- Interface of implications in the transaction extension pipeline.
- Integer
Square Root - A trait implementing integer square root.
- IsMember
- Determine if a
MemberIdis a valid member. - Lazy
- A lazy value.
- Lookup
- Means of changing one type into another in a manner dependent on the source type.
- Maybe
Convert - Fallible conversion trait returning an Option. Generic over both source and destination types.
- Maybe
Convert Back - Reversing fallible conversion trait returning an Option. Generic over both source and destination types.
- Maybe
Display - A type that implements Display when in std environment.
- Maybe
Equivalence - Definition for a bi-directional, fallible conversion between two types.
- Maybe
From Str - A type that implements FromStr when in std environment.
- Maybe
Hash - A type that implements Hash when in std environment.
- Maybe
Serialize - A type that implements Serialize when in std environment or serde feature is activated.
- Maybe
Serialize Deserialize - A type that implements Serialize, DeserializeOwned and Debug when in std environment or serde feature is activated.
- Member
- A type that can be used in runtime structures.
- Morph
- Extensible conversion trait. Generic over only source type, with destination type being associated.
- One
- Defines a multiplicative identity element for
Self. - Opaque
Keys - Opaque data type that may be destructured into a series of raw byte slices (which represent individual keys).
- Printable
- Trait for things which can be printed from the runtime.
- Refund
Weight - A type that can handle weight refunds.
- Saturated
Conversion - Convenience type to work around the highly unergonomic syntax needed
to invoke the functions of overloaded generic traits, in this case
SaturatedFromandSaturatedInto. - Saturating
- Saturating arithmetic operations, returning maximum or minimum values instead of overflowing.
- Scale
- Multiply and divide by a number that isn’t necessarily the same type. Basically just the same
as
MulandDivexcept it can be used for all basic numeric types. - Signature
Payload - Something that acts like a
SignaturePayloadof anExtrinsic. - Signed
Extension Deprecated - Means by which a transaction may be extended. This type embodies both the data and the logic that should be additionally associated with the transaction. It should be plain old data.
- Simple
BitOps - A meta trait for all bit ops.
- Static
Lookup - Means of changing one type into another in a manner dependent on the source type.
This variant is different to
Lookupin that it doesn’t (can cannot) require any context. - Transaction
Extension - Means by which a transaction may be extended. This type embodies both the data and the logic that should be additionally associated with the transaction. It should be plain old data.
- TryCollect
- Try and collect into a collection
C. - TryConvert
- Fallible conversion trait which returns the argument in the case of being unable to convert. Generic over both source and destination types.
- TryConvert
Back - Reversing fallible conversion trait which returns the argument in the case of being unable to convert back. Generic over both source and destination types.
- TryMorph
- Extensible conversion trait. Generic over only source type, with destination type being associated.
- Typed
Get - A trait for querying a single value from a type defined in the trait.
- Unique
Saturated From - Just like
Fromexcept that if the source value is too big to fit into the destination type then it’ll saturate the destination. - Unique
Saturated Into - Just like
Intoexcept that if the source value is too big to fit into the destination type then it’ll saturate the destination. - Validate
Unsigned - Provide validation for unsigned extrinsics.
- Verify
- Means of signature verification.
- Zero
- Defines an additive identity element for
Self.
Functions§
- checked_
pow - Raises a value to the power of exp, returning
Noneif an overflow occurred. - ensure_
pow - Raises a value to the power of exp, returning
ArithmeticErrorif an overflow occurred.
Type Aliases§
- Dispatch
Info Of - Shortcut to reference the
Infotype of aDispatchable. - Dispatch
Origin Of - Shortcut to reference the
RuntimeOrigintype of aDispatchable. - Hashing
For - Extract the hashing type for a block.
- Number
For - Extract the number type for a block.
- Post
Dispatch Info Of - Shortcut to reference the
PostInfotype of aDispatchable. - Validate
Result - Shortcut for the result value of the
validatefunction.
Derive Macros§
- Debug
- Derive macro generating an impl of the trait
Debug.