Crate tuxedo_core
source ·Expand description
This crate is the core of the Tuxedo runtime framework.
All Tuxedo runtimes will use this machinery and plug in their specific Tuxedo piece(s)
Re-exports§
pub use constraint_checker::ConstraintChecker;
pub use constraint_checker::SimpleConstraintChecker;
pub use inherents::InherentAdapter;
pub use inherents::InherentHooks;
pub use metadata::TuxedoMetadata;
pub use verifier::Verifier;
Modules§
- A constraint checker is a piece of logic that determines whether a transaction as a whole is valid and should be committed. Most tuxedo pieces will provide one or more constraint checkers. Constraint Checkers do not calculate the correct final state, but rather determine whether the proposed final state (as specified by the output set) meets the necessary constraints.
- Dynamic Typing utilities for Tuxedo runtimes
- Utilities for blockchainchain genesis used by Tuxedo.
- APIs and utilities for working with Substrate’s Inherents in Tuxedo based chains.
- A simple type to use as metadata. For now the metadata just communicates whether we are dealing with a parachain or not.
- These macros are copied from frame-support. Substrate maintainers are not open to putting them in a more sensible location. See https://github.com/paritytech/substrate/issues/13456
- General-purpose runtime traits for describing common types of on-chain logic. Tuxedo piece implementations may loosely couple through these traits.
- The common types that will be used across a Tuxedo runtime, and not specific to any one piece
- For now this is a higher level description of the default UTXO set features which Tuxedo chooses to use. Future UTXO sets could take a different form especially if being used for Zero-Knowledge. In the future it may likely be abstracted into a trait to support various UTXO set types.
- A verifier is a piece of logic that determines whether an input can be consumed in a given context. Because there are multiple reasonable ways to make this decision, we expose a trait to encapsulate the various options. Each runtime will choose to make one or more verifiers available to its users and they will be aggregated into an enum. The most common and useful verifiers are included here with Tuxedo core, but downstream developers are expected to create their own as well.
Macros§
- Evaluate
$x:expr
and if not true returnErr($y:expr)
. - Return Err of the expression:
return Err($expression);
.
Structs§
- The executive. Each runtime is encouraged to make a type alias called
Executive
that fills in the proper generic types.
Attribute Macros§
- Automatically implements
From
for each type in an aggregate type enum. - This macro treats the supplied enum as an aggregate constraint checker. As such, it implements the
From
trait for eah of the inner types. Then it implements theConstraintChecker
trait for this type for this enum by delegating to an inner type. - This macro treats the supplied enum as an aggregate verifier. As such, it implements the
From
trait for eah of the inner types. Then it implements theVerifier
trait for this type for this enum by delegating to an inner type.