Skip to content
Snippets Groups Projects
Select Git revision
  • 25c494b81d8392a3c140383f76e83016ff3985b2
  • master default protected
  • fix_picked_up_file_in_runtime_release
  • network/gtest-1000 protected
  • upgradable-multisig
  • runtime/gtest-1000
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • gtest-1000-0.11.1 protected
  • gtest-1000-0.11.0 protected
  • gtest-1000 protected
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
41 results

lib.rs

Blame
  • lib.rs 11.13 KiB
    //! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.
    
    #![cfg_attr(not(feature = "std"), no_std)]
    // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
    #![recursion_limit="256"]
    
    // Make the WASM binary available.
    #[cfg(feature = "std")]
    include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
    
    use sp_std::prelude::*;
    use sp_core::OpaqueMetadata;
    use sp_runtime::{
    	ApplyExtrinsicResult, transaction_validity::TransactionValidity, generic, create_runtime_str,
    	impl_opaque_keys, MultiSignature
    };
    use sp_runtime::traits::{
    	NumberFor, BlakeTwo256, Block as BlockT, StaticLookup, Verify, ConvertInto, IdentifyAccount
    };
    use sp_api::impl_runtime_apis;
    use sp_consensus_aura::sr25519::AuthorityId as AuraId;
    use grandpa::AuthorityList as GrandpaAuthorityList;
    use grandpa::fg_primitives;
    use sp_version::RuntimeVersion;
    #[cfg(feature = "std")]
    use sp_version::NativeVersion;
    
    // A few exports that help ease life for downstream crates.
    #[cfg(any(feature = "std", test))]
    pub use sp_runtime::BuildStorage;
    pub use timestamp::Call as TimestampCall;
    pub use balances::Call as BalancesCall;
    pub use sp_runtime::{Permill, Perbill};
    pub use frame_support::{
    	StorageValue, construct_runtime, parameter_types,
    	traits::Randomness,
    	weights::Weight,
    };
    
    /// An index to a block.
    pub type BlockNumber = u32;
    
    /// Alias to 512-bit hash when used in the context of a transaction signature on the chain.
    pub type Signature = MultiSignature;
    
    /// Some way of identifying an account on the chain. We intentionally make it equivalent
    /// to the public key of our transaction signing scheme.
    pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;
    
    /// The type for looking up accounts. We don't expect more than 4 billion of them, but you
    /// never know...
    pub type AccountIndex = u32;
    
    /// Balance of an account.
    pub type Balance = u128;
    
    /// Index of a transaction in the chain.
    pub type Index = u32;
    
    /// A hash of some data used by the chain.
    pub type Hash = sp_core::H256;
    
    /// Digest item type.
    pub type DigestItem = generic::DigestItem<Hash>;
    
    /// Used for the module template in `./template.rs`
    mod template;
    
    /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
    /// the specifics of the runtime. They can then be made to be agnostic over specific formats