mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Introduce Polkadot-Sdk developer_hub (#2102)
This PR introduces the new crate `developer_hub` into the polkadot-sdk repo. The vision for the developer-hub crate is detailed in [this document](https://docs.google.com/document/d/1XLLkFNE8v8HLvZpI2rzsa8N2IN1FcKntc8q-Sc4xBAk/edit?usp=sharing). <img width="1128" alt="Screenshot 2023-11-02 at 10 45 48" src="https://github.com/paritytech/polkadot-sdk/assets/5588131/1e12b60f-fef5-42c4-8503-a3ba234077c3"> Other than adding the new crate, it also does the following: * Remove the `substrate` crate, as there is now a unique umbrella crate for multiple things in `developer_hub::polkadot_sdk`. * (backport candidate) A minor change to `frame-support` macros that allows `T::RuntimeOrigin` to also be acceptable as the origin type. * (backport candidate) A minor change to `frame-system` that allows us to deposit events at genesis because now the real genesis config is generated via wasm, and we can safely assume `cfg!(feature = "std")` means only testing. related to #62. * (backport candidate) Introduces a small `read_events_for_pallet` to `frame_system` for easier event reading in tests. * From https://github.com/paritytech/polkadot-sdk-docs/issues/31, it takes action on improving the `pallet::call` docs. * From https://github.com/paritytech/polkadot-sdk-docs/issues/31, it takes action on improving the `UncheckedExtrinsic` docs. ## Way Forward First, a version of this is deployed temporarily [here](https://blog.kianenigma.nl/polkadot-sdk/developer_hub/index.html). I will keep it up to date on a daily basis. ### This Pull Request I see two ways forward: 1. We acknowledge that everything in `developer-hub` is going to be WIP, and merge this asap. We should not yet use links to this crate anywhere. 2. We make this be the feature branch, make PRs against this, and either gradually backport it, or only merge to master once it is done. I am personally in favor of option 1. If we stick to option 2, we need a better way to deploy a staging version of this to gh-pages. ### Issue Tracking The main issues related to the future of `developer_hub` are: - https://github.com/paritytech/polkadot-sdk-docs/issues/31 - https://github.com/paritytech/polkadot-sdk-docs/issues/4 - https://github.com/paritytech/polkadot-sdk-docs/issues/26 - https://github.com/paritytech/polkadot-sdk-docs/issues/32 - https://github.com/paritytech/polkadot-sdk-docs/issues/36 ### After This Pull Request - [ ] create a redirect for https://paritytech.github.io/polkadot-sdk/master/substrate/ - [x] analytics - [ ] link checker - [ ] the matter of publishing, and how all of these relative links for when we do, that is still an open question. There is section on this in the landing page. - [ ] updated https://paritytech.github.io/ --------- Co-authored-by: Liam Aharon <liam.aharon@hotmail.com> Co-authored-by: Juan Girini <juangirini@gmail.com> Co-authored-by: bader y <ibnbassem@gmail.com> Co-authored-by: Sebastian Kunert <skunert49@gmail.com> Co-authored-by: James Wilson <james@jsdw.me> Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
[package]
|
||||
name = "substrate"
|
||||
description = "Next-generation framework for blockchain innovation"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
homepage = "https://substrate.io"
|
||||
repository.workspace = true
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
version = "1.0.0"
|
||||
publish = false
|
||||
|
||||
# The dependencies are only needed for docs.
|
||||
[dependencies]
|
||||
simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", rev = "e48b187bcfd5cc75111acd9d241f1bd36604344b" }
|
||||
|
||||
subkey = { path = "bin/utils/subkey" }
|
||||
chain-spec-builder = { package = "staging-chain-spec-builder", path = "bin/utils/chain-spec-builder" }
|
||||
|
||||
sc-service = { path = "client/service" }
|
||||
sc-chain-spec = { path = "client/chain-spec" }
|
||||
sc-cli = { path = "client/cli" }
|
||||
sc-consensus-aura = { path = "client/consensus/aura" }
|
||||
sc-consensus-babe = { path = "client/consensus/babe" }
|
||||
sc-consensus-grandpa = { path = "client/consensus/grandpa" }
|
||||
sc-consensus-beefy = { path = "client/consensus/beefy" }
|
||||
sc-consensus-manual-seal = { path = "client/consensus/manual-seal" }
|
||||
sc-consensus-pow = { path = "client/consensus/pow" }
|
||||
|
||||
sp-runtime = { path = "primitives/runtime" }
|
||||
frame-support = { path = "frame/support" }
|
||||
@@ -18,7 +18,7 @@
|
||||
//! Collection of allocator implementations.
|
||||
//!
|
||||
//! This crate provides the following allocator implementations:
|
||||
//! - A freeing-bump allocator: [`FreeingBumpHeapAllocator`](freeing_bump::FreeingBumpHeapAllocator)
|
||||
//! - A freeing-bump allocator: [`FreeingBumpHeapAllocator`]
|
||||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ pub use sc_executor_wasmtime::InstantiationStrategy as WasmtimeInstantiationStra
|
||||
|
||||
/// Extracts the runtime version of a given runtime code.
|
||||
pub trait RuntimeVersionOf {
|
||||
/// Extract [`RuntimeVersion`](sp_version::RuntimeVersion) of the given `runtime_code`.
|
||||
/// Extract [`RuntimeVersion`] of the given `runtime_code`.
|
||||
fn runtime_version(
|
||||
&self,
|
||||
ext: &mut dyn Externalities,
|
||||
|
||||
@@ -49,8 +49,7 @@
|
||||
//! - **Total Issuance:** The total number of units in existence in a system.
|
||||
//!
|
||||
//! - **Reaping an account:** The act of removing an account by resetting its nonce. Happens after
|
||||
//! its
|
||||
//! total balance has become zero (or, strictly speaking, less than the Existential Deposit).
|
||||
//! its total balance has become zero (or, strictly speaking, less than the Existential Deposit).
|
||||
//!
|
||||
//! - **Free Balance:** The portion of a balance that is not reserved. The free balance is the only
|
||||
//! balance that matters for most operations.
|
||||
@@ -59,24 +58,23 @@
|
||||
//! Reserved balance can still be slashed, but only after all the free balance has been slashed.
|
||||
//!
|
||||
//! - **Imbalance:** A condition when some funds were credited or debited without equal and opposite
|
||||
//! accounting
|
||||
//! (i.e. a difference between total issuance and account balances). Functions that result in an
|
||||
//! imbalance will return an object of the `Imbalance` trait that can be managed within your runtime
|
||||
//! logic. (If an imbalance is simply dropped, it should automatically maintain any book-keeping
|
||||
//! such as total issuance.)
|
||||
//! accounting (i.e. a difference between total issuance and account balances). Functions that
|
||||
//! result in an imbalance will return an object of the `Imbalance` trait that can be managed within
|
||||
//! your runtime logic. (If an imbalance is simply dropped, it should automatically maintain any
|
||||
//! book-keeping such as total issuance.)
|
||||
//!
|
||||
//! - **Lock:** A freeze on a specified amount of an account's free balance until a specified block
|
||||
//! number. Multiple
|
||||
//! locks always operate over the same funds, so they "overlay" rather than "stack".
|
||||
//! number. Multiple locks always operate over the same funds, so they "overlay" rather than
|
||||
//! "stack".
|
||||
//!
|
||||
//! ### Implementations
|
||||
//!
|
||||
//! The Balances pallet provides implementations for the following traits. If these traits provide
|
||||
//! the functionality that you need, then you can avoid coupling with the Balances pallet.
|
||||
//!
|
||||
//! - [`Currency`](frame_support::traits::Currency): Functions for dealing with a
|
||||
//! - [`Currency`]: Functions for dealing with a
|
||||
//! fungible assets system.
|
||||
//! - [`ReservableCurrency`](frame_support::traits::ReservableCurrency):
|
||||
//! - [`ReservableCurrency`]
|
||||
//! - [`NamedReservableCurrency`](frame_support::traits::NamedReservableCurrency):
|
||||
//! Functions for dealing with assets that can be reserved from an account.
|
||||
//! - [`LockableCurrency`](frame_support::traits::LockableCurrency): Functions for
|
||||
@@ -105,7 +103,7 @@
|
||||
//! ```
|
||||
//! use frame_support::traits::Currency;
|
||||
//! # pub trait Config: frame_system::Config {
|
||||
//! # type Currency: Currency<Self::AccountId>;
|
||||
//! # type Currency: Currency<Self::AccountId>;
|
||||
//! # }
|
||||
//!
|
||||
//! pub type BalanceOf<T> = <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
|
||||
@@ -120,26 +118,26 @@
|
||||
//! use frame_support::traits::{WithdrawReasons, LockableCurrency};
|
||||
//! use sp_runtime::traits::Bounded;
|
||||
//! pub trait Config: frame_system::Config {
|
||||
//! type Currency: LockableCurrency<Self::AccountId, Moment=frame_system::pallet_prelude::BlockNumberFor<Self>>;
|
||||
//! type Currency: LockableCurrency<Self::AccountId, Moment=frame_system::pallet_prelude::BlockNumberFor<Self>>;
|
||||
//! }
|
||||
//! # struct StakingLedger<T: Config> {
|
||||
//! # stash: <T as frame_system::Config>::AccountId,
|
||||
//! # total: <<T as Config>::Currency as frame_support::traits::Currency<<T as frame_system::Config>::AccountId>>::Balance,
|
||||
//! # phantom: std::marker::PhantomData<T>,
|
||||
//! # stash: <T as frame_system::Config>::AccountId,
|
||||
//! # total: <<T as Config>::Currency as frame_support::traits::Currency<<T as frame_system::Config>::AccountId>>::Balance,
|
||||
//! # phantom: std::marker::PhantomData<T>,
|
||||
//! # }
|
||||
//! # const STAKING_ID: [u8; 8] = *b"staking ";
|
||||
//!
|
||||
//! fn update_ledger<T: Config>(
|
||||
//! controller: &T::AccountId,
|
||||
//! ledger: &StakingLedger<T>
|
||||
//! controller: &T::AccountId,
|
||||
//! ledger: &StakingLedger<T>
|
||||
//! ) {
|
||||
//! T::Currency::set_lock(
|
||||
//! STAKING_ID,
|
||||
//! &ledger.stash,
|
||||
//! ledger.total,
|
||||
//! WithdrawReasons::all()
|
||||
//! );
|
||||
//! // <Ledger<T>>::insert(controller, ledger); // Commented out as we don't have access to Staking's storage here.
|
||||
//! T::Currency::set_lock(
|
||||
//! STAKING_ID,
|
||||
//! &ledger.stash,
|
||||
//! ledger.total,
|
||||
//! WithdrawReasons::all()
|
||||
//! );
|
||||
//! // <Ledger<T>>::insert(controller, ledger); // Commented out as we don't have access to Staking's storage here.
|
||||
//! }
|
||||
//! # fn main() {}
|
||||
//! ```
|
||||
|
||||
@@ -110,7 +110,7 @@ pub fn migrate<
|
||||
}
|
||||
|
||||
/// Some checks prior to migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::pre_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::pre_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn pre_migration<T: pallet_bounties::Config, P: GetStorageVersion + 'static, N: AsRef<str>>(
|
||||
@@ -164,7 +164,7 @@ pub fn pre_migration<T: pallet_bounties::Config, P: GetStorageVersion + 'static,
|
||||
}
|
||||
|
||||
/// Some checks for after migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::post_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::post_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn post_migration<T: pallet_bounties::Config, P: GetStorageVersion, N: AsRef<str>>(
|
||||
|
||||
@@ -76,7 +76,7 @@ pub fn migrate<T: frame_system::Config, P: GetStorageVersion + PalletInfoAccess,
|
||||
}
|
||||
|
||||
/// Some checks prior to migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::pre_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::pre_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn pre_migrate<P: GetStorageVersion + PalletInfoAccess, N: AsRef<str>>(old_pallet_name: N) {
|
||||
@@ -104,7 +104,7 @@ pub fn pre_migrate<P: GetStorageVersion + PalletInfoAccess, N: AsRef<str>>(old_p
|
||||
}
|
||||
|
||||
/// Some checks for after migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::post_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::post_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn post_migrate<P: GetStorageVersion + PalletInfoAccess, N: AsRef<str>>(old_pallet_name: N) {
|
||||
|
||||
@@ -80,11 +80,7 @@ frame_election_provider_support::generate_solution_type!(
|
||||
|
||||
/// All events of this pallet.
|
||||
pub(crate) fn multi_phase_events() -> Vec<super::Event<Runtime>> {
|
||||
System::events()
|
||||
.into_iter()
|
||||
.map(|r| r.event)
|
||||
.filter_map(|e| if let RuntimeEvent::MultiPhase(inner) = e { Some(inner) } else { None })
|
||||
.collect::<Vec<_>>()
|
||||
System::read_events_for_pallet::<super::Event<Runtime>>()
|
||||
}
|
||||
|
||||
/// To from `now` to block `n`.
|
||||
|
||||
@@ -69,7 +69,7 @@ pub fn migrate<T: crate::Config, N: AsRef<str>>(new_pallet_name: N) -> Weight {
|
||||
}
|
||||
|
||||
/// Some checks prior to migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::pre_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::pre_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn pre_migration<T: crate::Config, N: AsRef<str>>(new: N) {
|
||||
@@ -97,7 +97,7 @@ pub fn pre_migration<T: crate::Config, N: AsRef<str>>(new: N) {
|
||||
}
|
||||
|
||||
/// Some checks for after migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::post_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::post_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn post_migration<T: crate::Config>() {
|
||||
|
||||
@@ -71,7 +71,7 @@ pub fn pre_migrate_fn<T: Config>(to_migrate: Vec<T::AccountId>) -> Box<dyn Fn()
|
||||
}
|
||||
|
||||
/// Some checks for after migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::post_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::post_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn post_migrate<T: crate::Config>() {
|
||||
|
||||
@@ -292,9 +292,8 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
/// Allows you to define an enum on the pallet which will then instruct
|
||||
/// `construct_runtime` to amalgamate all similarly-named enums from other
|
||||
/// pallets into an aggregate enum.
|
||||
/// Allows you to define an enum on the pallet which will then instruct `construct_runtime` to
|
||||
/// amalgamate all similarly-named enums from other pallets into an aggregate enum.
|
||||
#[pallet::composite_enum]
|
||||
pub enum HoldReason {
|
||||
Staking,
|
||||
|
||||
@@ -39,6 +39,7 @@ impl<T: Config> frame_support::traits::Get<u32> for MaxChecking<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[docify::export]
|
||||
pub(crate) type BalanceOf<T> =
|
||||
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
|
||||
/// An unstake request.
|
||||
|
||||
@@ -63,7 +63,7 @@ pub fn migrate<T: crate::Config, N: AsRef<str>>(new_pallet_name: N) -> Weight {
|
||||
}
|
||||
|
||||
/// Some checks prior to migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::pre_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::pre_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn pre_migration<T: crate::Config, N: AsRef<str>>(new: N) {
|
||||
@@ -99,7 +99,7 @@ pub fn pre_migration<T: crate::Config, N: AsRef<str>>(new: N) {
|
||||
}
|
||||
|
||||
/// Some checks for after migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::post_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::post_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn post_migration() {
|
||||
|
||||
@@ -77,7 +77,7 @@ pub fn migrate<T: frame_system::Config, P: GetStorageVersion + PalletInfoAccess,
|
||||
}
|
||||
|
||||
/// Some checks prior to migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::pre_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::pre_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn pre_migrate<P: GetStorageVersion, N: AsRef<str>>(old_pallet_name: N, new_pallet_name: N) {
|
||||
@@ -105,7 +105,7 @@ pub fn pre_migrate<P: GetStorageVersion, N: AsRef<str>>(old_pallet_name: N, new_
|
||||
}
|
||||
|
||||
/// Some checks for after migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::post_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::post_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn post_migrate<P: GetStorageVersion, N: AsRef<str>>(old_pallet_name: N, new_pallet_name: N) {
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
|
||||
//! Off-chain logic for creating a proof based data provided by on-chain logic.
|
||||
//!
|
||||
//! Validator-set extracting an iterator from an off-chain worker stored list containing
|
||||
//! historical validator-sets.
|
||||
//! Based on the logic of historical slashing, but the validation is done off-chain.
|
||||
//! Validator-set extracting an iterator from an off-chain worker stored list containing historical
|
||||
//! validator-sets. Based on the logic of historical slashing, but the validation is done off-chain.
|
||||
//! Use [`fn store_current_session_validator_set_to_offchain()`](super::onchain) to store the
|
||||
//! required data to the offchain validator set.
|
||||
//! This is used in conjunction with [`ProvingTrie`](super::ProvingTrie) and
|
||||
//! the off-chain indexing API.
|
||||
//! required data to the offchain validator set. This is used in conjunction with [`ProvingTrie`]
|
||||
//! and the off-chain indexing API.
|
||||
|
||||
use sp_runtime::{
|
||||
offchain::storage::{MutateStorageError, StorageRetrievalError, StorageValueRef},
|
||||
|
||||
+23
-13
@@ -15,10 +15,6 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! > Made for [![polkadot]](https://polkadot.network)
|
||||
//!
|
||||
//! [polkadot]: https://img.shields.io/badge/polkadot-E6007A?style=for-the-badge&logo=polkadot&logoColor=white
|
||||
//!
|
||||
//! # FRAME
|
||||
//!
|
||||
//! ```no_compile
|
||||
@@ -34,14 +30,21 @@
|
||||
//! > **F**ramework for **R**untime **A**ggregation of **M**odularized **E**ntities: Substrate's
|
||||
//! > State Transition Function (Runtime) Framework.
|
||||
//!
|
||||
//! ## Documentation
|
||||
//!
|
||||
//! See [`polkadot_sdk::frame`](../developer_hub/polkadot_sdk/frame_runtime/index.html).
|
||||
//!
|
||||
//! ## Warning: Experimental
|
||||
//!
|
||||
//! This crate and all of its content is experimental, and should not yet be used in production.
|
||||
//!
|
||||
//! ## Getting Started
|
||||
//! ## Underlying dependencies
|
||||
//!
|
||||
//! TODO: link to `developer_hub::polkadot_sdk::frame`. The `developer_hub` hasn't been published
|
||||
//! yet, this can be updated once it is linkable.
|
||||
//! This crate is an amalgamation of multiple other crates that are often used together to compose a
|
||||
//! pallet. It is not necessary to use it, and it may fall short for certain purposes.
|
||||
//!
|
||||
//! In short, this crate only re-exports types and traits from multiple sources. All of these
|
||||
//! sources are listed (and re-exported again) in [`deps`].
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg(feature = "experimental")]
|
||||
@@ -54,9 +57,19 @@
|
||||
/// `#[pallet::bar]` inside the mod.
|
||||
pub use frame_support::pallet;
|
||||
|
||||
pub use frame_support::pallet_macros::{import_section, pallet_section};
|
||||
|
||||
/// The logging library of the runtime. Can normally be the classic `log` crate.
|
||||
pub use log;
|
||||
|
||||
/// A list of all macros used within the main [`pallet`] macro.
|
||||
///
|
||||
/// Note: All of these macros are "stubs" and not really usable outside `#[pallet] mod pallet { ..
|
||||
/// }`. They are mainly provided for documentation and IDE support.
|
||||
pub mod pallet_macros {
|
||||
pub use frame_support::{derive_impl, pallet, pallet_macros::*};
|
||||
}
|
||||
|
||||
/// The main prelude of FRAME.
|
||||
///
|
||||
/// This prelude should almost always be the first line of code in any pallet or runtime.
|
||||
@@ -78,9 +91,6 @@ pub mod prelude {
|
||||
/// Pallet prelude of `frame-support`.
|
||||
///
|
||||
/// Note: this needs to revised once `frame-support` evolves.
|
||||
// `frame-support` will be break down https://github.com/paritytech/polkadot-sdk/issues/127 and its reexports will
|
||||
// most likely change. These wildcard reexportings can be optimized once `frame-support` has
|
||||
// changed.
|
||||
#[doc(no_inline)]
|
||||
pub use frame_support::pallet_prelude::*;
|
||||
|
||||
@@ -156,6 +166,9 @@ pub mod runtime {
|
||||
/// Types to define your runtime version.
|
||||
pub use sp_version::{create_runtime_str, runtime_version, RuntimeVersion};
|
||||
|
||||
/// Macro to implement runtime APIs.
|
||||
pub use sp_api::impl_runtime_apis;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub use sp_version::NativeVersion;
|
||||
}
|
||||
@@ -180,9 +193,6 @@ pub mod runtime {
|
||||
pub use sp_inherents::{CheckInherentsResult, InherentData};
|
||||
pub use sp_runtime::ApplyExtrinsicResult;
|
||||
|
||||
/// Macro to implement runtime APIs.
|
||||
pub use sp_api::impl_runtime_apis;
|
||||
|
||||
pub use frame_system_rpc_runtime_api::*;
|
||||
pub use sp_api::{self, *};
|
||||
pub use sp_block_builder::*;
|
||||
|
||||
@@ -1097,8 +1097,11 @@ pub fn weight(_: TokenStream, _: TokenStream) -> TokenStream {
|
||||
pallet_macro_stub()
|
||||
}
|
||||
|
||||
/// Compact encoding for arguments can be achieved via `#[pallet::compact]`. The function must
|
||||
/// return a `DispatchResultWithPostInfo` or `DispatchResult`.
|
||||
///
|
||||
/// ---
|
||||
///
|
||||
/// **Rust-Analyzer users**: See the documentation of the Rust item in
|
||||
/// [`frame_support::pallet_macros::call`](../../frame_support/pallet_macros/attr.call.html).
|
||||
#[proc_macro_attribute]
|
||||
pub fn compact(_: TokenStream, _: TokenStream) -> TokenStream {
|
||||
pallet_macro_stub()
|
||||
@@ -1108,7 +1111,7 @@ pub fn compact(_: TokenStream, _: TokenStream) -> TokenStream {
|
||||
/// ---
|
||||
///
|
||||
/// **Rust-Analyzer users**: See the documentation of the Rust item in
|
||||
/// `frame_support::pallet_macros::call`.
|
||||
/// [`frame_support::pallet_macros::call`](../../frame_support/pallet_macros/attr.call.html).
|
||||
#[proc_macro_attribute]
|
||||
pub fn call(_: TokenStream, _: TokenStream) -> TokenStream {
|
||||
pallet_macro_stub()
|
||||
@@ -1117,41 +1120,10 @@ pub fn call(_: TokenStream, _: TokenStream) -> TokenStream {
|
||||
/// Each dispatchable may also be annotated with the `#[pallet::call_index($idx)]` attribute,
|
||||
/// which explicitly defines the codec index for the dispatchable function in the `Call` enum.
|
||||
///
|
||||
/// All call indexes start from 0, until it encounters a dispatchable function with a defined
|
||||
/// call index. The dispatchable function that lexically follows the function with a defined
|
||||
/// call index will have that call index, but incremented by 1, e.g. if there are 3
|
||||
/// dispatchable functions `fn foo`, `fn bar` and `fn qux` in that order, and only `fn bar`
|
||||
/// has a call index of 10, then `fn qux` will have an index of 11, instead of 1.
|
||||
/// ---
|
||||
///
|
||||
/// All arguments must implement [`Debug`], [`PartialEq`], [`Eq`], `Decode`, `Encode`, and
|
||||
/// [`Clone`]. For ease of use, bound by the trait `frame_support::pallet_prelude::Member`.
|
||||
///
|
||||
/// If no `#[pallet::call]` exists, then a default implementation corresponding to the
|
||||
/// following code is automatically generated:
|
||||
///
|
||||
/// ```ignore
|
||||
/// #[pallet::call]
|
||||
/// impl<T: Config> Pallet<T> {}
|
||||
/// ```
|
||||
///
|
||||
/// **WARNING**: modifying dispatchables, changing their order, removing some, etc., must be
|
||||
/// done with care. Indeed this will change the outer runtime call type (which is an enum with
|
||||
/// one variant per pallet), this outer runtime call can be stored on-chain (e.g. in
|
||||
/// `pallet-scheduler`). Thus migration might be needed. To mitigate against some of this, the
|
||||
/// `#[pallet::call_index($idx)]` attribute can be used to fix the order of the dispatchable so
|
||||
/// that the `Call` enum encoding does not change after modification. As a general rule of
|
||||
/// thumb, it is therefore adventageous to always add new calls to the end so you can maintain
|
||||
/// the existing order of calls.
|
||||
///
|
||||
/// ### Macro expansion
|
||||
///
|
||||
/// The macro creates an enum `Call` with one variant per dispatchable. This enum implements:
|
||||
/// [`Clone`], [`Eq`], [`PartialEq`], [`Debug`] (with stripped implementation in `not("std")`),
|
||||
/// `Encode`, `Decode`, `GetDispatchInfo`, `GetCallName`, `GetCallIndex` and
|
||||
/// `UnfilteredDispatchable`.
|
||||
///
|
||||
/// The macro implements the `Callable` trait on `Pallet` and a function `call_functions`
|
||||
/// which returns the dispatchable metadata.
|
||||
/// **Rust-Analyzer users**: See the documentation of the Rust item in
|
||||
/// [`frame_support::pallet_macros::call`](../../frame_support/pallet_macros/attr.call.html).
|
||||
#[proc_macro_attribute]
|
||||
pub fn call_index(_: TokenStream, _: TokenStream) -> TokenStream {
|
||||
pallet_macro_stub()
|
||||
|
||||
@@ -26,6 +26,7 @@ use syn::{spanned::Spanned, ExprClosure};
|
||||
mod keyword {
|
||||
syn::custom_keyword!(Call);
|
||||
syn::custom_keyword!(OriginFor);
|
||||
syn::custom_keyword!(RuntimeOrigin);
|
||||
syn::custom_keyword!(weight);
|
||||
syn::custom_keyword!(call_index);
|
||||
syn::custom_keyword!(compact);
|
||||
@@ -158,10 +159,10 @@ impl syn::parse::Parse for ArgAttrIsCompact {
|
||||
}
|
||||
}
|
||||
|
||||
/// Check the syntax is `OriginFor<T>` or `&OriginFor<T>`.
|
||||
/// Check the syntax is `OriginFor<T>`, `&OriginFor<T>` or `T::RuntimeOrigin`.
|
||||
pub fn check_dispatchable_first_arg_type(ty: &syn::Type, is_ref: bool) -> syn::Result<()> {
|
||||
pub struct CheckDispatchableFirstArg(bool);
|
||||
impl syn::parse::Parse for CheckDispatchableFirstArg {
|
||||
pub struct CheckOriginFor(bool);
|
||||
impl syn::parse::Parse for CheckOriginFor {
|
||||
fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
|
||||
let is_ref = input.parse::<syn::Token![&]>().is_ok();
|
||||
input.parse::<keyword::OriginFor>()?;
|
||||
@@ -173,14 +174,27 @@ pub fn check_dispatchable_first_arg_type(ty: &syn::Type, is_ref: bool) -> syn::R
|
||||
}
|
||||
}
|
||||
|
||||
let result = syn::parse2::<CheckDispatchableFirstArg>(ty.to_token_stream());
|
||||
return match result {
|
||||
Ok(CheckDispatchableFirstArg(has_ref)) if is_ref == has_ref => Ok(()),
|
||||
_ => {
|
||||
pub struct CheckRuntimeOrigin;
|
||||
impl syn::parse::Parse for CheckRuntimeOrigin {
|
||||
fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
|
||||
input.parse::<keyword::T>()?;
|
||||
input.parse::<syn::Token![::]>()?;
|
||||
input.parse::<keyword::RuntimeOrigin>()?;
|
||||
|
||||
Ok(Self)
|
||||
}
|
||||
}
|
||||
|
||||
let result_origin_for = syn::parse2::<CheckOriginFor>(ty.to_token_stream());
|
||||
let result_runtime_origin = syn::parse2::<CheckRuntimeOrigin>(ty.to_token_stream());
|
||||
return match (result_origin_for, result_runtime_origin) {
|
||||
(Ok(CheckOriginFor(has_ref)), _) if is_ref == has_ref => Ok(()),
|
||||
(_, Ok(_)) => Ok(()),
|
||||
(_, _) => {
|
||||
let msg = if is_ref {
|
||||
"Invalid type: expected `&OriginFor<T>`"
|
||||
} else {
|
||||
"Invalid type: expected `OriginFor<T>`"
|
||||
"Invalid type: expected `OriginFor<T>` or `T::RuntimeOrigin`"
|
||||
};
|
||||
return Err(syn::Error::new(ty.span(), msg))
|
||||
},
|
||||
@@ -282,8 +296,8 @@ impl CallDef {
|
||||
0 if dev_mode => CallWeightDef::DevModeDefault,
|
||||
0 => return Err(syn::Error::new(
|
||||
method.sig.span(),
|
||||
"A pallet::call requires either a concrete `#[pallet::weight($expr)]` or an
|
||||
inherited weight from the `#[pallet:call(weight($type))]` attribute, but
|
||||
"A pallet::call requires either a concrete `#[pallet::weight($expr)]` or an
|
||||
inherited weight from the `#[pallet:call(weight($type))]` attribute, but
|
||||
none were given.",
|
||||
)),
|
||||
1 => match weight_attrs.pop().unwrap() {
|
||||
|
||||
@@ -36,7 +36,8 @@ use sp_weights::Weight;
|
||||
/// returned from a dispatch.
|
||||
pub type DispatchResultWithPostInfo = sp_runtime::DispatchResultWithInfo<PostDispatchInfo>;
|
||||
|
||||
/// Unaugmented version of `DispatchResultWithPostInfo` that can be returned from
|
||||
#[docify::export]
|
||||
/// Un-augmented version of `DispatchResultWithPostInfo` that can be returned from
|
||||
/// dispatchable functions and is automatically converted to the augmented type. Should be
|
||||
/// used whenever the `PostDispatchInfo` does not need to be overwritten. As this should
|
||||
/// be the common case it is the implicit return type when none is specified.
|
||||
|
||||
@@ -47,6 +47,8 @@ pub mod __private {
|
||||
pub use sp_core::{OpaqueMetadata, Void};
|
||||
pub use sp_core_hashing_proc_macro;
|
||||
pub use sp_inherents;
|
||||
#[cfg(feature = "std")]
|
||||
pub use sp_io::TestExternalities;
|
||||
pub use sp_io::{self, hashing, storage::root as storage_root};
|
||||
pub use sp_metadata_ir as metadata_ir;
|
||||
#[cfg(feature = "std")]
|
||||
@@ -2226,13 +2228,159 @@ pub use frame_support_procedural::pallet;
|
||||
/// Contains macro stubs for all of the pallet:: macros
|
||||
pub mod pallet_macros {
|
||||
pub use frame_support_procedural::{
|
||||
call_index, compact, composite_enum, config, disable_frame_system_supertrait_check, error,
|
||||
event, extra_constants, feeless_if, generate_deposit, generate_store, getter, hooks,
|
||||
composite_enum, config, disable_frame_system_supertrait_check, error, event,
|
||||
extra_constants, feeless_if, generate_deposit, generate_store, getter, hooks,
|
||||
import_section, inherent, no_default, no_default_bounds, origin, pallet_section,
|
||||
storage_prefix, storage_version, type_value, unbounded, validate_unsigned, weight,
|
||||
whitelist_storage,
|
||||
};
|
||||
|
||||
/// Allows a pallet to declare a set of functions as a *dispatchable extrinsic*. In
|
||||
/// slightly simplified terms, this macro declares the set of "transactions" of a pallet.
|
||||
///
|
||||
/// > The exact definition of **extrinsic** can be found in
|
||||
/// > [`sp_runtime::generic::UncheckedExtrinsic`].
|
||||
///
|
||||
/// A **dispatchable** is a common term in FRAME, referring to process of constructing a
|
||||
/// function, and dispatching it with the correct inputs. This is commonly used with
|
||||
/// extrinsics, for example "an extrinsic has been dispatched". See
|
||||
/// [`sp_runtime::traits::Dispatchable`] and [`crate::traits::UnfilteredDispatchable`].
|
||||
///
|
||||
/// ## Call Enum
|
||||
///
|
||||
/// The macro is called `call` (rather than `#[pallet::extrinsics]`) because of the
|
||||
/// generation of a `enum Call`. This enum contains only the encoding of the function
|
||||
/// arguments of the dispatchable, alongside the information needed to route it to the
|
||||
/// correct function.
|
||||
///
|
||||
/// ```
|
||||
/// #[frame_support::pallet(dev_mode)]
|
||||
/// pub mod custom_pallet {
|
||||
/// # use frame_support::pallet_prelude::*;
|
||||
/// # use frame_system::pallet_prelude::*;
|
||||
/// # #[pallet::config]
|
||||
/// # pub trait Config: frame_system::Config {}
|
||||
/// # #[pallet::pallet]
|
||||
/// # pub struct Pallet<T>(_);
|
||||
/// # use frame_support::traits::BuildGenesisConfig;
|
||||
/// #[pallet::call]
|
||||
/// impl<T: Config> Pallet<T> {
|
||||
/// pub fn some_dispatchable(_origin: OriginFor<T>, _input: u32) -> DispatchResult {
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// pub fn other(_origin: OriginFor<T>, _input: u64) -> DispatchResult {
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// // generates something like:
|
||||
/// // enum Call<T: Config> {
|
||||
/// // some_dispatchable { input: u32 }
|
||||
/// // other { input: u64 }
|
||||
/// // }
|
||||
/// }
|
||||
///
|
||||
/// fn main() {
|
||||
/// # use frame_support::{derive_impl, construct_runtime};
|
||||
/// # use frame_support::__private::codec::Encode;
|
||||
/// # use frame_support::__private::TestExternalities;
|
||||
/// # use frame_support::traits::UnfilteredDispatchable;
|
||||
/// # impl custom_pallet::Config for Runtime {}
|
||||
/// # #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
/// # impl frame_system::Config for Runtime {
|
||||
/// # type Block = frame_system::mocking::MockBlock<Self>;
|
||||
/// # }
|
||||
/// construct_runtime! {
|
||||
/// pub struct Runtime {
|
||||
/// System: frame_system,
|
||||
/// Custom: custom_pallet
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// # TestExternalities::new_empty().execute_with(|| {
|
||||
/// let origin: RuntimeOrigin = frame_system::RawOrigin::Signed(10).into();
|
||||
/// // calling into a dispatchable from within the runtime is simply a function call.
|
||||
/// let _ = custom_pallet::Pallet::<Runtime>::some_dispatchable(origin.clone(), 10);
|
||||
///
|
||||
/// // calling into a dispatchable from the outer world involves constructing the bytes of
|
||||
/// let call = custom_pallet::Call::<Runtime>::some_dispatchable { input: 10 };
|
||||
/// let _ = call.clone().dispatch_bypass_filter(origin);
|
||||
///
|
||||
/// // the routing of a dispatchable is simply done through encoding of the `Call` enum,
|
||||
/// // which is the index of the variant, followed by the arguments.
|
||||
/// assert_eq!(call.encode(), vec![0u8, 10, 0, 0, 0]);
|
||||
///
|
||||
/// // notice how in the encoding of the second function, the first byte is different and
|
||||
/// // referring to the second variant of `enum Call`.
|
||||
/// let call = custom_pallet::Call::<Runtime>::other { input: 10 };
|
||||
/// assert_eq!(call.encode(), vec![1u8, 10, 0, 0, 0, 0, 0, 0, 0]);
|
||||
/// # });
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// Further properties of dispatchable functions are as follows:
|
||||
///
|
||||
/// - Unless if annotated by `dev_mode`, it must contain [`weight`] to denote the
|
||||
/// pre-dispatch weight consumed.
|
||||
/// - The dispatchable must declare its index via [`call_index`], which can override the
|
||||
/// position of a function in `enum Call`.
|
||||
/// - The first argument is always an `OriginFor` (or `T::RuntimeOrigin`).
|
||||
/// - The return type is always [`crate::dispatch::DispatchResult`] (or
|
||||
/// [`crate::dispatch::DispatchResultWithPostInfo`]).
|
||||
///
|
||||
/// **WARNING**: modifying dispatchables, changing their order (i.e. using [`call_index`]),
|
||||
/// removing some, etc., must be done with care. This will change the encoding of the , and
|
||||
/// the call can be stored on-chain (e.g. in `pallet-scheduler`). Thus, migration might be
|
||||
/// needed. This is why the use of `call_index` is mandatory by default in FRAME.
|
||||
///
|
||||
/// ## Default Behavior
|
||||
///
|
||||
/// If no `#[pallet::call]` exists, then a default implementation corresponding to the
|
||||
/// following code is automatically generated:
|
||||
///
|
||||
/// ```ignore
|
||||
/// #[pallet::call]
|
||||
/// impl<T: Config> Pallet<T> {}
|
||||
/// ```
|
||||
pub use frame_support_procedural::call;
|
||||
|
||||
/// Enforce the index of a variant in the generated `enum Call`. See [`call`] for more
|
||||
/// information.
|
||||
///
|
||||
/// All call indexes start from 0, until it encounters a dispatchable function with a
|
||||
/// defined call index. The dispatchable function that lexically follows the function with
|
||||
/// a defined call index will have that call index, but incremented by 1, e.g. if there are
|
||||
/// 3 dispatchable functions `fn foo`, `fn bar` and `fn qux` in that order, and only `fn
|
||||
/// bar` has a call index of 10, then `fn qux` will have an index of 11, instead of 1.
|
||||
pub use frame_support_procedural::call_index;
|
||||
|
||||
/// Declares the arguments of a [`call`] function to be encoded using
|
||||
/// [`codec::Compact`]. This will results in smaller extrinsic encoding.
|
||||
///
|
||||
/// A common example of `compact` is for numeric values that are often times far far away
|
||||
/// from their theoretical maximum. For example, in the context of a crypto-currency, the
|
||||
/// balance of an individual account is oftentimes way less than what the numeric type
|
||||
/// allows. In all such cases, using `compact` is sensible.
|
||||
///
|
||||
/// ```
|
||||
/// #[frame_support::pallet(dev_mode)]
|
||||
/// pub mod custom_pallet {
|
||||
/// # use frame_support::pallet_prelude::*;
|
||||
/// # use frame_system::pallet_prelude::*;
|
||||
/// # #[pallet::config]
|
||||
/// # pub trait Config: frame_system::Config {}
|
||||
/// # #[pallet::pallet]
|
||||
/// # pub struct Pallet<T>(_);
|
||||
/// # use frame_support::traits::BuildGenesisConfig;
|
||||
/// #[pallet::call]
|
||||
/// impl<T: Config> Pallet<T> {
|
||||
/// pub fn some_dispatchable(_origin: OriginFor<T>, #[pallet::compact] _input: u32) -> DispatchResult {
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
pub use frame_support_procedural::compact;
|
||||
|
||||
/// Allows you to define the genesis configuration for the pallet.
|
||||
///
|
||||
/// Item is defined as either an enum or a struct. It needs to be public and implement the
|
||||
|
||||
@@ -224,8 +224,7 @@ impl PalletVersionToStorageVersionHelper for T {
|
||||
}
|
||||
}
|
||||
|
||||
/// Migrate from the `PalletVersion` struct to the new
|
||||
/// [`StorageVersion`](crate::traits::StorageVersion) struct.
|
||||
/// Migrate from the `PalletVersion` struct to the new [`StorageVersion`] struct.
|
||||
///
|
||||
/// This will remove all `PalletVersion's` from the state and insert the current storage version.
|
||||
pub fn migrate_from_pallet_version_to_storage_version<
|
||||
|
||||
@@ -165,9 +165,9 @@ pub fn kill_storage(child_info: &ChildInfo, limit: Option<u32>) -> KillStorageRe
|
||||
/// guarantee that the subsequent call is in a new block; in this case the previous call's result
|
||||
/// cursor need not be passed in an a `None` may be passed instead. This exception may be useful
|
||||
/// then making this call solely from a block-hook such as `on_initialize`.
|
||||
///
|
||||
/// Returns [`MultiRemovalResults`](sp_io::MultiRemovalResults) to inform about the result. Once the
|
||||
/// resultant `maybe_cursor` field is `None`, then no further items remain to be deleted.
|
||||
|
||||
/// Returns [`MultiRemovalResults`] to inform about the result. Once the resultant `maybe_cursor`
|
||||
/// field is `None`, then no further items remain to be deleted.
|
||||
///
|
||||
/// NOTE: After the initial call for any given child storage, it is important that no keys further
|
||||
/// keys are inserted. If so, then they may or may not be deleted by subsequent calls.
|
||||
|
||||
@@ -1583,7 +1583,7 @@ pub trait StorageTryAppend<Item>: StorageDecodeLength + private::Sealed {
|
||||
fn bound() -> usize;
|
||||
}
|
||||
|
||||
/// Storage value that is capable of [`StorageTryAppend`](crate::storage::StorageTryAppend).
|
||||
/// Storage value that is capable of [`StorageTryAppend`].
|
||||
pub trait TryAppendValue<T: StorageTryAppend<I>, I: Encode> {
|
||||
/// Try and append the `item` into the storage item.
|
||||
///
|
||||
@@ -1612,7 +1612,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Storage map that is capable of [`StorageTryAppend`](crate::storage::StorageTryAppend).
|
||||
/// Storage map that is capable of [`StorageTryAppend`].
|
||||
pub trait TryAppendMap<K: Encode, T: StorageTryAppend<I>, I: Encode> {
|
||||
/// Try and append the `item` into the storage map at the given `key`.
|
||||
///
|
||||
@@ -1646,7 +1646,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Storage double map that is capable of [`StorageTryAppend`](crate::storage::StorageTryAppend).
|
||||
/// Storage double map that is capable of [`StorageTryAppend`].
|
||||
pub trait TryAppendDoubleMap<K1: Encode, K2: Encode, T: StorageTryAppend<I>, I: Encode> {
|
||||
/// Try and append the `item` into the storage double map at the given `key`.
|
||||
///
|
||||
|
||||
+4
-4
@@ -97,7 +97,7 @@ note: required because it appears within the type `RuntimeEvent`
|
||||
| ||_- in this macro invocation
|
||||
... |
|
||||
note: required by a bound in `EncodeLike`
|
||||
--> $CARGO/parity-scale-codec-3.6.4/src/encode_like.rs
|
||||
--> $CARGO/parity-scale-codec-3.6.5/src/encode_like.rs
|
||||
|
|
||||
| pub trait EncodeLike<T: Encode = Self>: Sized + Encode {}
|
||||
| ^^^^^ required by this bound in `EncodeLike`
|
||||
@@ -129,7 +129,7 @@ note: required because it appears within the type `RuntimeEvent`
|
||||
| ||_- in this macro invocation
|
||||
... |
|
||||
note: required by a bound in `Decode`
|
||||
--> $CARGO/parity-scale-codec-3.6.4/src/codec.rs
|
||||
--> $CARGO/parity-scale-codec-3.6.5/src/codec.rs
|
||||
|
|
||||
| pub trait Decode: Sized {
|
||||
| ^^^^^ required by this bound in `Decode`
|
||||
@@ -301,7 +301,7 @@ note: required because it appears within the type `RuntimeCall`
|
||||
| ||_- in this macro invocation
|
||||
... |
|
||||
note: required by a bound in `EncodeLike`
|
||||
--> $CARGO/parity-scale-codec-3.6.4/src/encode_like.rs
|
||||
--> $CARGO/parity-scale-codec-3.6.5/src/encode_like.rs
|
||||
|
|
||||
| pub trait EncodeLike<T: Encode = Self>: Sized + Encode {}
|
||||
| ^^^^^ required by this bound in `EncodeLike`
|
||||
@@ -334,7 +334,7 @@ note: required because it appears within the type `RuntimeCall`
|
||||
| ||_- in this macro invocation
|
||||
... |
|
||||
note: required by a bound in `Decode`
|
||||
--> $CARGO/parity-scale-codec-3.6.4/src/codec.rs
|
||||
--> $CARGO/parity-scale-codec-3.6.5/src/codec.rs
|
||||
|
|
||||
| pub trait Decode: Sized {
|
||||
| ^^^^^ required by this bound in `Decode`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
error: Invalid type: expected `OriginFor<T>`
|
||||
error: Invalid type: expected `OriginFor<T>` or `T::RuntimeOrigin`
|
||||
--> tests/pallet_ui/call_invalid_origin_type.rs:34:22
|
||||
|
|
||||
34 | pub fn foo(origin: u8) {}
|
||||
|
||||
@@ -25,7 +25,7 @@ sp-runtime = { path = "../../primitives/runtime", default-features = false, feat
|
||||
sp-std = { path = "../../primitives/std", default-features = false}
|
||||
sp-version = { path = "../../primitives/version", default-features = false, features = ["serde"] }
|
||||
sp-weights = { path = "../../primitives/weights", default-features = false, features = ["serde"] }
|
||||
docify = "0.2.0"
|
||||
docify = "0.2.6"
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.4.0"
|
||||
|
||||
@@ -1018,6 +1018,7 @@ impl_ensure_origin_with_arg_ignoring_arg! {
|
||||
{}
|
||||
}
|
||||
|
||||
#[docify::export]
|
||||
/// Ensure that the origin `o` represents a signed extrinsic (i.e. transaction).
|
||||
/// Returns `Ok` with the account that signed the extrinsic or an `Err` otherwise.
|
||||
pub fn ensure_signed<OuterOrigin, AccountId>(o: OuterOrigin) -> Result<AccountId, BadOrigin>
|
||||
@@ -1372,6 +1373,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// NOTE: Events not registered at the genesis block and quietly omitted.
|
||||
pub fn deposit_event_indexed(topics: &[T::Hash], event: T::RuntimeEvent) {
|
||||
let block_number = Self::block_number();
|
||||
|
||||
// Don't populate events on genesis.
|
||||
if block_number.is_zero() {
|
||||
return
|
||||
@@ -1555,12 +1557,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// NOTE: Events not registered at the genesis block and quietly omitted.
|
||||
#[cfg(any(feature = "std", feature = "runtime-benchmarks", test))]
|
||||
pub fn events() -> Vec<EventRecord<T::RuntimeEvent, T::Hash>> {
|
||||
debug_assert!(
|
||||
!Self::block_number().is_zero(),
|
||||
"events not registered at the genesis block"
|
||||
);
|
||||
// Dereferencing the events here is fine since we are not in the
|
||||
// memory-restricted runtime.
|
||||
// Dereferencing the events here is fine since we are not in the memory-restricted runtime.
|
||||
Self::read_events_no_consensus().map(|e| *e).collect()
|
||||
}
|
||||
|
||||
@@ -1581,6 +1578,21 @@ impl<T: Config> Pallet<T> {
|
||||
Events::<T>::stream_iter()
|
||||
}
|
||||
|
||||
/// Read and return the events of a specific pallet, as denoted by `E`.
|
||||
///
|
||||
/// This is useful for a pallet that wishes to read only the events it has deposited into
|
||||
/// `frame_system` using the standard `fn deposit_event`.
|
||||
pub fn read_events_for_pallet<E>() -> Vec<E>
|
||||
where
|
||||
T::RuntimeEvent: TryInto<E>,
|
||||
{
|
||||
Events::<T>::get()
|
||||
.into_iter()
|
||||
.map(|er| er.event)
|
||||
.filter_map(|e| e.try_into().ok())
|
||||
.collect::<_>()
|
||||
}
|
||||
|
||||
/// Set the block number to something in particular. Can be used as an alternative to
|
||||
/// `initialize` for tests that don't need to bother with the other environment entries.
|
||||
#[cfg(any(feature = "std", feature = "runtime-benchmarks", test))]
|
||||
|
||||
@@ -90,7 +90,7 @@ pub fn migrate<T: pallet_tips::Config, P: GetStorageVersion + PalletInfoAccess,
|
||||
}
|
||||
|
||||
/// Some checks prior to migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::pre_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::pre_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn pre_migrate<
|
||||
@@ -129,7 +129,7 @@ pub fn pre_migrate<
|
||||
}
|
||||
|
||||
/// Some checks for after migration. This can be linked to
|
||||
/// [`frame_support::traits::OnRuntimeUpgrade::post_upgrade`] for further testing.
|
||||
/// `frame_support::traits::OnRuntimeUpgrade::post_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn post_migrate<
|
||||
|
||||
@@ -406,14 +406,14 @@ pub use sp_api_proc_macro::impl_runtime_apis;
|
||||
|
||||
/// Mocks given trait implementations as runtime apis.
|
||||
///
|
||||
/// Accepts similar syntax as [`impl_runtime_apis!`] and generates
|
||||
/// simplified mock implementations of the given runtime apis. The difference in syntax is that
|
||||
/// the trait does not need to be referenced by a qualified path, methods accept the `&self`
|
||||
/// parameter and the error type can be specified as associated type. If no error type is
|
||||
/// specified [`String`] is used as error type.
|
||||
/// Accepts similar syntax as [`impl_runtime_apis!`] and generates simplified mock
|
||||
/// implementations of the given runtime apis. The difference in syntax is that the trait does
|
||||
/// not need to be referenced by a qualified path, methods accept the `&self` parameter and the
|
||||
/// error type can be specified as associated type. If no error type is specified [`String`] is
|
||||
/// used as error type.
|
||||
///
|
||||
/// Besides implementing the given traits, the [`Core`](sp_api::Core) and
|
||||
/// [`ApiExt`](sp_api::ApiExt) are implemented automatically.
|
||||
/// Besides implementing the given traits, the [`Core`] and [`ApiExt`] are implemented
|
||||
/// automatically.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
//! - [`ghragmms`](phragmms::phragmms()): Implements a hybrid approach inspired by Phragmén which is
|
||||
//! executed faster but it can achieve a constant factor approximation of the maximin problem,
|
||||
//! similar to that of the MMS algorithm.
|
||||
//! - [`balance`](balancing::balance): Implements the star balancing algorithm. This iterative
|
||||
//! process can push a solution toward being more "balanced", which in turn can increase its
|
||||
//! score.
|
||||
//! - [`balance`]: Implements the star balancing algorithm. This iterative process can push a
|
||||
//! solution toward being more "balanced", which in turn can increase its score.
|
||||
//!
|
||||
//! ### Terminology
|
||||
//!
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Provides the [`PassBy`](PassBy) trait to simplify the implementation of the
|
||||
//! Provides the [`PassBy`] trait to simplify the implementation of the
|
||||
//! runtime interface traits for custom types.
|
||||
//!
|
||||
//! [`Codec`], [`Inner`] and [`Enum`] are the provided strategy implementations.
|
||||
|
||||
@@ -29,6 +29,9 @@ sp-core = { path = "../core", default-features = false}
|
||||
sp-io = { path = "../io", default-features = false}
|
||||
sp-std = { path = "../std", default-features = false}
|
||||
sp-weights = { path = "../weights", default-features = false}
|
||||
docify = { version = "0.2.6" }
|
||||
|
||||
simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", branch = "main" }
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.8.5"
|
||||
|
||||
@@ -26,9 +26,11 @@ use crate::{
|
||||
transaction_validity::{TransactionSource, TransactionValidity},
|
||||
};
|
||||
|
||||
/// Definition of something that the external world might want to say; its
|
||||
/// existence implies that it has been checked and is good, particularly with
|
||||
/// regards to the signature.
|
||||
/// Definition of something that the external world might want to say; its existence implies that it
|
||||
/// has been checked and is good, particularly with regards to the signature.
|
||||
///
|
||||
/// This is typically passed into [`traits::Applyable::apply`], which should execute
|
||||
/// [`CheckedExtrinsic::function`], alongside all other bits and bobs.
|
||||
#[derive(PartialEq, Eq, Clone, sp_core::RuntimeDebug)]
|
||||
pub struct CheckedExtrinsic<AccountId, Call, Extra> {
|
||||
/// Who this purports to be from and the number of extrinsics have come before
|
||||
|
||||
@@ -43,16 +43,37 @@ const EXTRINSIC_FORMAT_VERSION: u8 = 4;
|
||||
/// The `SingaturePayload` of `UncheckedExtrinsic`.
|
||||
type UncheckedSignaturePayload<Address, Signature, Extra> = (Address, Signature, Extra);
|
||||
|
||||
/// A extrinsic right from the external world. This is unchecked and so
|
||||
/// can contain a signature.
|
||||
/// An extrinsic right from the external world. This is unchecked and so can contain a signature.
|
||||
///
|
||||
/// An extrinsic is formally described as any external data that is originating from the outside of
|
||||
/// the runtime and fed into the runtime as a part of the block-body.
|
||||
///
|
||||
/// Inherents are special types of extrinsics that are placed into the block by the block-builder.
|
||||
/// They are unsigned because the assertion is that they are "inherently true" by virtue of getting
|
||||
/// past all validators.
|
||||
///
|
||||
/// Transactions are all other statements provided by external entities that the chain deems values
|
||||
/// and decided to include in the block. This value is typically in the form of fee payment, but it
|
||||
/// could in principle be any other interaction. Transactions are either signed or unsigned. A
|
||||
/// sensible transaction pool should ensure that only transactions that are worthwhile are
|
||||
/// considered for block-building.
|
||||
#[doc = simple_mermaid::mermaid!("../../../../../docs/mermaid/extrinsics.mmd")]
|
||||
/// This type is by no means enforced within Substrate, but given its genericness, it is highly
|
||||
/// likely that for most use-cases it will suffice. Thus, the encoding of this type will dictate
|
||||
/// exactly what bytes should be sent to a runtime to transact with it.
|
||||
///
|
||||
/// This can be checked using [`Checkable`], yielding a [`CheckedExtrinsic`], which is the
|
||||
/// counterpart of this type after its signature (and other non-negotiable validity checks) have
|
||||
/// passed.
|
||||
#[derive(PartialEq, Eq, Clone)]
|
||||
pub struct UncheckedExtrinsic<Address, Call, Signature, Extra>
|
||||
where
|
||||
Extra: SignedExtension,
|
||||
{
|
||||
/// The signature, address, number of extrinsics have come before from
|
||||
/// the same signer and an era describing the longevity of this transaction,
|
||||
/// if this is a signed extrinsic.
|
||||
/// The signature, address, number of extrinsics have come before from the same signer and an
|
||||
/// era describing the longevity of this transaction, if this is a signed extrinsic.
|
||||
///
|
||||
/// `None` if it is unsigned or an inherent.
|
||||
pub signature: Option<UncheckedSignaturePayload<Address, Signature, Extra>>,
|
||||
/// The function that should be called.
|
||||
pub function: Call,
|
||||
@@ -286,6 +307,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[docify::export(unchecked_extrinsic_encode_impl)]
|
||||
impl<Address, Call, Signature, Extra> Encode for UncheckedExtrinsic<Address, Call, Signature, Extra>
|
||||
where
|
||||
Address: Encode,
|
||||
|
||||
@@ -250,7 +250,7 @@ impl<B: BlockNumberProvider> Lockable for BlockAndTime<B> {
|
||||
///
|
||||
/// A lock that is persisted in the DB and provides the ability to guard against
|
||||
/// concurrent access in an off-chain worker, with a defined expiry deadline
|
||||
/// based on the concrete [`Lockable`](Lockable) implementation.
|
||||
/// based on the concrete [`Lockable`] implementation.
|
||||
pub struct StorageLock<'a, L = Time> {
|
||||
// A storage value ref which defines the DB entry representing the lock.
|
||||
value_ref: StorageValueRef<'a>,
|
||||
|
||||
@@ -1,242 +0,0 @@
|
||||
// This file is part of Substrate.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//! # Substrate
|
||||
//!
|
||||
//! Substrate is a Rust framework for building blockchains in a modular and extensible way. While in
|
||||
//! itself un-opinionated, it is the main engine behind the Polkadot ecosystem.
|
||||
//!
|
||||
//! [![github]](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/) - [![polkadot]](https://polkadot.network)
|
||||
//!
|
||||
//! This crate in itself does not contain any code and is just meant ot be a documentation hub for
|
||||
//! substrate-based crates.
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! Substrate approaches blockchain development with an acknowledgement of a few self-evident
|
||||
//! truths:
|
||||
//!
|
||||
//! 1. Society and technology evolves.
|
||||
//! 2. Humans are fallible.
|
||||
//!
|
||||
//! This, specifically, makes the task of designing a correct, safe and long-lasting blockchain
|
||||
//! system hard.
|
||||
//!
|
||||
//! Nonetheless, in order to achieve this goal, substrate embraces the following:
|
||||
//!
|
||||
//! 1. Use of **Rust** as a modern, and safe programming language, which limits human error through
|
||||
//! various means, most notably memory safety.
|
||||
//! 2. Substrate is written from the ground-up with a generic, modular and extensible design. This
|
||||
//! ensures that software components can be easily swapped and upgraded. Examples of this is
|
||||
//! multiple consensus mechanisms provided by Substrate, as listed below.
|
||||
//! 3. Lastly, the final blockchain system created with the above properties needs to be
|
||||
//! upgradeable. In order to achieve this, Substrate is designed as a meta-protocol, whereby the
|
||||
//! application logic of the blockchain (called "Runtime") is encoded as a Wasm blob, and is
|
||||
//! stored onchain. The rest of the system (called "Client") acts as the executor of the Wasm
|
||||
//! blob.
|
||||
//!
|
||||
//! In essence, the meta-protocol of all Substrate based chains is the "Runtime as Wasm blob"
|
||||
//! accord. This enables the Runtime to become inherently upgradeable (without forks). The upgrade
|
||||
//! is merely a matter of the Wasm blob being changed in the chain state, which is, in principle,
|
||||
//! same as updating an account's balance.
|
||||
//!
|
||||
//! ### Architecture
|
||||
//!
|
||||
//! Therefore, Substrate can be visualized as follows:
|
||||
#![doc = simple_mermaid::mermaid!("../../docs/mermaid/substrate_simple.mmd")]
|
||||
//!
|
||||
//! The client and the runtime of course need to communicate. This is done through two concepts:
|
||||
//!
|
||||
//! 1. Host functions: a way for the (Wasm) runtime to talk to the client. All host functions are
|
||||
//! defined in [`sp-io`]. For example, [`sp-io::storage`] are the set of host functions that
|
||||
//! allow the runtime to read and write data to the on-chain state.
|
||||
//! 2. Runtime APIs: a way for the client to talk to the Wasm runtime. Runtime APIs are defined
|
||||
//! using macros and utilities in [`sp-api`]. For example, [`sp-api::Core`] is the most basic
|
||||
//! runtime API that any blockchain must implement in order to be able to (re) execute blocks.
|
||||
#![doc = simple_mermaid::mermaid!("../../docs/mermaid/substrate_client_runtime.mmd")]
|
||||
//!
|
||||
//! [`FRAME`], Substrate's default runtime development library takes the above even further by
|
||||
//! embracing a declarative programming model whereby correctness is enhanced and the system is
|
||||
//! highly configurable through parameterization.
|
||||
//!
|
||||
//! All in all, this design enables all substrate-based chains to achieve forkless, self-enacting
|
||||
//! upgrades out of the box. Combined with governance abilities that are shipped with `FRAME`, this
|
||||
//! enables a chain to survive the test of time.
|
||||
//!
|
||||
//! ## How to Get Stared
|
||||
//!
|
||||
//! Most developers want to leave the client side code as-is, and focus on the runtime. To do so,
|
||||
//! look into the [`frame`] crate, which is the entry point crate into runtime development with
|
||||
//! FRAME.
|
||||
//!
|
||||
//! > Side note, it is entirely possible to craft a substrate-based runtime without FRAME, an
|
||||
//! > example of which can be found [here](https://github.com/JoshOrndorff/frameless-node-template).
|
||||
//!
|
||||
//! In more broad terms, the following avenues exist into developing with substrate:
|
||||
//!
|
||||
//! * **Templates**: A number of substrate-based templates exist and they can be used for various
|
||||
//! purposes, with zero to little additional code needed. All of these templates contain runtimes
|
||||
//! that are highly configurable and are likely suitable for basic needs.
|
||||
//! * [`FRAME`]: If need, one can customize that runtime even further, by using `FRAME` and
|
||||
//! developing custom modules.
|
||||
//! * **Core**: To the contrary, some developers may want to customize the client side software to
|
||||
//! achieve novel goals such as a new consensus engine, or a new database backend. While
|
||||
//! Substrate's main configurability is in the runtime, the client is also highly generic and can
|
||||
//! be customized to a great extent.
|
||||
//!
|
||||
//! ## Structure
|
||||
//!
|
||||
//! Substrate is a massive cargo workspace with hundreds of crates, therefore it is useful to know
|
||||
//! how to navigate its crates.
|
||||
//!
|
||||
//! In broad terms, it is divided into three categories:
|
||||
//!
|
||||
//! * `sc-*` (short for *substrate-client*) crates, located under `./client` folder. These are all
|
||||
//! the client crates. Notable examples are crates such as [`sc-network`], various consensus
|
||||
//! crates, [`sc-rpc-api`] and [`sc-client-db`], all of which are expected to reside in the client
|
||||
//! side.
|
||||
//! * `sp-*` (short for *substrate-primitives*) crates, located under `./primitives` folder. These
|
||||
//! are the traits that glue the client and runtime together, but are not opinionated about what
|
||||
//! framework is using for building the runtime. Notable examples are [`sp-api`] and [`sp-io`],
|
||||
//! which form the communication bridge between the client and runtime.
|
||||
//! * `pallet-*` and `frame-*` crates, located under `./frame` folder. These are the crates related
|
||||
//! to FRAME. See [`frame`] for more information.
|
||||
//!
|
||||
//! ### Wasm Build
|
||||
//!
|
||||
//! Many of the Substrate crates, such as entire `sp-*`, need to compile to both Wasm (when a Wasm
|
||||
//! runtime is being generated) and native (for example, when testing). To achieve this, Substrate
|
||||
//! follows the convention of the Rust community, and uses a `feature = "std"` to signify that a
|
||||
//! crate is being built with the standard library, and is built for native. Otherwise, it is built
|
||||
//! for `no_std`.
|
||||
//!
|
||||
//! This can be summarized in `#![cfg_attr(not(feature = "std"), no_std)]`, which you can often find
|
||||
//! in any Substrate-based runtime.
|
||||
//!
|
||||
//! Substrate-based runtimes use [`substrate-wasm-builder`] in their `build.rs` to automatically
|
||||
//! build their Wasm files as a part of normal build commandsOnce built, the wasm file is placed in
|
||||
//! `./target/{debug|release}/wbuild/{runtime_name}.wasm`.
|
||||
//!
|
||||
//! ### Binaries
|
||||
//!
|
||||
//! Multiple binaries are shipped with substrate, the most important of which are located in the
|
||||
//! `./bin` folder.
|
||||
//!
|
||||
//! * [`node`] is an extensive substrate node that contains the superset of all runtime and client
|
||||
//! side features. The corresponding runtime, called [`kitchensink_runtime`] contains all of the
|
||||
//! modules that are provided with `FRAME`. This node and runtime is only used for testing and
|
||||
//! demonstration.
|
||||
//! * [`chain-spec-builder`]: Utility to build more detailed [chain-spec][`sc-chain-spec`] for the
|
||||
//! aforementioned node. Other projects typically contain a `build-spec` subcommand that does the
|
||||
//! same.
|
||||
//! * [`node-template`]: a template node that contains a minimal set of features and can act as a
|
||||
//! starting point of a project.
|
||||
//! * [`subkey`]: Substrate's key management utility.
|
||||
//!
|
||||
//! ### Anatomy of a Binary Crate
|
||||
//!
|
||||
//! From the above, [`node`] and [`node-template`] are essentially blueprints of a substrate-based
|
||||
//! project, as the name of the latter is implying. Each substrate-based project typically contains
|
||||
//! the following:
|
||||
//!
|
||||
//! * Under `./runtime`, a `./runtime/src/lib.rs` which is the top level runtime amalgamator file.
|
||||
//! This file typically contains the [`frame_support::construct_runtime`] macro, which is the
|
||||
//! final definition of a runtime.
|
||||
//!
|
||||
//! * Under `./node`, a `main.rs`, which is the point, and a `./service.rs`, which contains all the
|
||||
//! client side components. Skimming this file yields an overview of the networking, database,
|
||||
//! consensus and similar client side components.
|
||||
//!
|
||||
//! > The above two are conventions, not rules.
|
||||
//!
|
||||
//! ## Parachain?
|
||||
//!
|
||||
//! As noted above, Substrate is the main engine behind the Polkadot ecosystem. One of the ways
|
||||
//! through which Polkadot can be utilized is by building "parachains", blockchains that are
|
||||
//! connected to Polkadot's shared security.
|
||||
//!
|
||||
//! To build a parachain, one could use
|
||||
//! [`Cumulus`](https://github.com/paritytech/polkadot-sdk/tree/master/cumulus), the library on top
|
||||
//! of Substrate, empowering any substrate-based chain to be a Polkadot parachain.
|
||||
//!
|
||||
//! ## Where To Go Next?
|
||||
//!
|
||||
//! Additional noteworthy crates within substrate:
|
||||
//!
|
||||
//! - Chain specification of a Substrate node:
|
||||
//! - [`sc-chain-spec`]
|
||||
//! - RPC APIs of a Substrate node: [`sc-rpc-api`]/[`sc-rpc`]
|
||||
//! - CLI Options of a Substrate node: [`sc-cli`]
|
||||
//! - All of the consensus related crates provided by Substrate:
|
||||
//! - [`sc-consensus-aura`]
|
||||
//! - [`sc-consensus-babe`]
|
||||
//! - [`sc-consensus-grandpa`]
|
||||
//! - [`sc-consensus-beefy`]
|
||||
//! - [`sc-consensus-manual-seal`]
|
||||
//! - [`sc-consensus-pow`]
|
||||
//!
|
||||
//! Additional noteworthy external resources:
|
||||
//!
|
||||
//! - [Substrate Developer Hub](https://substrate.dev)
|
||||
//! - [Parity Tech's Documentation Hub](https://paritytech.github.io/)
|
||||
//! - [Frontier: Substrate's Ethereum Compatibility Library](https://paritytech.github.io/frontier/)
|
||||
//! - [Polkadot Wiki](https://wiki.polkadot.network/en/)
|
||||
//!
|
||||
//! Notable upstream crates:
|
||||
//!
|
||||
//! - [`parity-scale-codec`](https://github.com/paritytech/parity-scale-codec)
|
||||
//! - [`parity-db`](https://github.com/paritytech/parity-db)
|
||||
//! - [`trie`](https://github.com/paritytech/trie)
|
||||
//! - [`parity-common`](https://github.com/paritytech/parity-common)
|
||||
//!
|
||||
//! Templates:
|
||||
//!
|
||||
//! - classic [`substrate-node-template`](https://github.com/substrate-developer-hub/substrate-node-template)
|
||||
//! - classic [cumulus-parachain-template](https://github.com/substrate-developer-hub/substrate-parachain-template)
|
||||
//! - [`extended-parachain-template`](https://github.com/paritytech/extended-parachain-template)
|
||||
//! - [`frontier-parachain-template`](https://github.com/paritytech/frontier-parachain-template)
|
||||
//!
|
||||
//! [polkadot]:
|
||||
//! https://img.shields.io/badge/polkadot-E6007A?style=for-the-badge&logo=polkadot&logoColor=white
|
||||
//! [github]:
|
||||
//! https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
|
||||
//! [`FRAME`]: ../frame/index.html
|
||||
//! [`sp-io`]: ../sp_io/index.html
|
||||
//! [`sp-api`]: ../sp_api/index.html
|
||||
//! [`sp-api`]: ../sp_api/index.html
|
||||
//! [`sc-client-db`]: ../sc_client_db/index.html
|
||||
//! [`sc-chain-spec`]: ../sc_chain_spec/index.html
|
||||
//! [`sc-network`]: ../sc_network/index.html
|
||||
//! [`sc-rpc-api`]: ../sc_rpc_api/index.html
|
||||
//! [`sc-rpc`]: ../sc_rpc/index.html
|
||||
//! [`sc-cli`]: ../sc_cli/index.html
|
||||
//! [`sc-consensus-aura`]: ../sc_consensus_aura/index.html
|
||||
//! [`sc-consensus-babe`]: ../sc_consensus_babe/index.html
|
||||
//! [`sc-consensus-grandpa`]: ../sc_consensus_grandpa/index.html
|
||||
//! [`sc-consensus-beefy`]: ../sc_consensus_beefy/index.html
|
||||
//! [`sc-consensus-manual-seal`]: ../sc_consensus_manual_seal/index.html
|
||||
//! [`sc-consensus-pow`]: ../sc_consensus_pow/index.html
|
||||
//! [`node`]: ../node_cli/index.html
|
||||
//! [`node-template`]: ../node_template/index.html
|
||||
//! [`kitchensink_runtime`]: ../kitchensink_runtime/index.html
|
||||
//! [`subkey`]: ../subkey/index.html
|
||||
//! [`chain-spec-builder`]: ../chain_spec_builder/index.html
|
||||
//! [`substrate-wasm-builder`]: https://crates.io/crates/substrate-wasm-builder
|
||||
|
||||
#![deny(rustdoc::broken_intra_doc_links)]
|
||||
#![deny(rustdoc::private_intra_doc_links)]
|
||||
Reference in New Issue
Block a user