Crate gclient::ext::sp_runtime

Expand description

§Substrate Runtime Primitives.

This crate, among other things, contains a large library of types and utilities that are used in the Substrate runtime, but are not particularly FRAME-oriented.

§Block, Header and Extrinsics

Most notable, this crate contains some of the types and trait that enable important communication between the client and the runtime. This includes:

§Runtime API Types

This crate also contains some types that are often used in conjuncture with Runtime APIs. Most notable:

  • ApplyExtrinsicResult, and DispatchOutcome, which dictate how the client and runtime communicate about the success or failure of an extrinsic.
  • transaction_validity, which dictates how the client and runtime communicate about the validity of an extrinsic while still in the transaction-queue.

Modules§

  • Traits and macros for constructing application specific strongly typed crypto wrappers.
  • Infinite precision unsigned integer for substrate runtime.
  • Parity SCALE Codec
  • Provides some utilities to define a piecewise linear function.
  • Some helper functions to work with 128bit numbers. Note that the functionality provided here is only sensible to use with 128bit numbers because for smaller sizes, you can always rely on assumptions of a bigger type (u128) being available, or simply create a per-thing and use the multiplication implementation provided there.
  • Runtime types that existed in old API versions.
  • A collection of higher lever helpers for offchain calls.
  • A logger that can be used to log from the runtime.
  • Efficient and space-efficient serialization of Rust types.
  • Testing utilities.
  • Primitives for the runtime modules.
  • Transaction validity interface.
  • Provides a type that wraps another type and provides a default value.

Macros§

Structs§

  • An opaque 32-byte cryptographic identifier.
  • Signature verify that can work with any known signature types..
  • A bounded map based on a B-Tree.
  • A bounded set based on a B-Tree.
  • A bounded slice.
  • A bounded vector.
  • An identifier for a specific cryptographic algorithm used by a key pair
  • Generic header digest.
  • Result of a Dispatchable which contains the DispatchResult and additional information about the Dispatchable that is only known post dispatch.
  • A fixed point number representation in the range. Fixed Point 64 bits signed, range = [-9223372036.854775808, 9223372036.854775807]
  • A fixed point number representation in the range. Fixed Point 128 bits signed, range = [-170141183460469231731.687303715884105728, 170141183460469231731.687303715884105727]
  • A fixed point number representation in the range. Fixed Point 64 bits unsigned, range = [0.000000000, 18446744073.709551615]
  • A fixed point number representation in the range. Fixed Point 128 bits unsigned, range = [0.000000000000000000, 340282366920938463463.374607431768211455]
  • Collection of justifications for a given block, multiple justifications may be provided by different consensus engines for the same block.
  • An identifier for a type of cryptographic key.
  • Reason why a pallet call failed.
  • Simple blob to hold an extrinsic without committing to its format and ensure it is serialized correctly.
  • Simple blob that hold a value in an encoded form without committing to its type.
  • A fixed point representation of a number in the range [0, 1].
  • A fixed point representation of a number in the range [0, 1].
  • A fixed point representation of a number in the range [0, 1].
  • A fixed point representation of a number in the range [0, 1].
  • A fixed point representation of a number in the range [0, 1].
  • A wrapper for any rational number with a 128 bit numerator and denominator.
  • Struct containing data needed for a storage.
  • Child trie storage data.
  • A contiguous growable array type, written as Vec<T>, short for ‘vector’.
  • A weakly bounded vector.

Enums§

  • Arithmetic errors.
  • Digest item that is able to encode/decode ‘system’ digest items and provide opaque access to other items.
  • Reason why a dispatch call failed.
  • The enum Either with variants Left and Right is a general purpose sum type with two cases.
  • Confines the kind of extrinsics that can be included in a block.
  • A multi-format address wrapper for on-chain accounts.
  • Signature verify that can work with any known signature types.
  • Public key for any known crypto algorithm.
  • The rounding method to use for unsigned quantities.
  • A string that wraps a &'static str in the runtime and String/Vec<u8> on decode.
  • Different possible state version.
  • Description of what went wrong when trying to complete an operation on a token.
  • Describes on what should happen with a storage transaction.
  • Errors related to transactional storage layers.

Constants§

Traits§

  • Something that is bound to a fixed RuntimeAppPublic.
  • Something that can build the genesis storage of a module.
  • Complex storage builder stuff.
  • Type which has a particular kind of crypto associated with it.
  • A data structure that can be deserialized from any data format supported by Serde.
  • A data structure that can be deserialized without borrowing any data from the deserializer.
  • Something that implements a decimal fixed point number.
  • Integer types that can be used to interact with FixedPointNumber implementations.
  • Something that implements a fixed point ration with an arbitrary granularity X, as parts per X.
  • Runtime interface for an application’s public key.
  • Convenience type to work around the highly unergonomic syntax needed to invoke the functions of overloaded generic traits, in this case SaturatedFrom and SaturatedInto.
  • Saturating arithmetic operations, returning maximum or minimum values instead of overflowing.
  • A data structure that can be serialized into any data format supported by Serde.
  • Provide a simple 4 byte identifier for a type.

Functions§

  • Print something that implements Printable from the runtime.
  • Utility function to declare string literals backed by an array of length N.
  • Verify a signature on an encoded value in a lazy manner. This can be an optimization if the signature scheme has an “unsigned” escape hash.

Type Aliases§

  • The result of applying of an extrinsic.
  • Same as ApplyExtrinsicResult but augmented with PostDispatchInfo on success.
  • Consensus engine unique ID.
  • This type specifies the outcome of dispatching a call to a module.
  • This is the legacy return type of Dispatchable. It is still exposed for compatibility reasons. The new return type is DispatchResultWithInfo. FRAME runtimes should use frame_support::dispatch::DispatchResult.
  • Return type of a Dispatchable which contains the DispatchResult and additional information about the Dispatchable that is only known post dispatch.
  • The encoded justification specific to a consensus engine.
  • Get the inner type of a PerThing.
  • An abstraction over justification for a block’s validity under a consensus algorithm.
  • The error type used as return type in try runtime hooks.
  • Get the upper type of a PerThing.

Derive Macros§