mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 17:28:00 +00:00
14bb115193
* Scale trait and move to u32 blocknumbers. * Fixes * Cleanups * Update node/runtime/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Fix up some of the factory stuff. * Update core/sr-primitives/src/traits.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Move Nonce/Index to u32 (#3361) * Force a non-borked version of upstream crate * Line lengths and runtime version bump
69 lines
2.2 KiB
Rust
69 lines
2.2 KiB
Rust
// Copyright 2018-2019 Parity Technologies (UK) Ltd.
|
|
// This file is part of Substrate.
|
|
|
|
// Substrate 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.
|
|
|
|
// Substrate 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 Substrate. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
//! Low-level types used throughout the Substrate code.
|
|
|
|
#![warn(missing_docs)]
|
|
|
|
#![cfg_attr(not(feature = "std"), no_std)]
|
|
|
|
use sr_primitives::{
|
|
generic, traits::{Verify, BlakeTwo256}, OpaqueExtrinsic, AnySignature
|
|
};
|
|
|
|
/// 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 = AnySignature;
|
|
|
|
/// 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;
|
|
|
|
/// 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;
|
|
|
|
/// Type used for expressing timestamp.
|
|
pub type Moment = u64;
|
|
|
|
/// Index of a transaction in the chain.
|
|
pub type Index = u32;
|
|
|
|
/// A hash of some data used by the chain.
|
|
pub type Hash = primitives::H256;
|
|
|
|
/// A timestamp: milliseconds since the unix epoch.
|
|
/// `u64` is enough to represent a duration of half a billion years, when the
|
|
/// time scale is milliseconds.
|
|
pub type Timestamp = u64;
|
|
|
|
/// Digest item type.
|
|
pub type DigestItem = generic::DigestItem<Hash>;
|
|
/// Header type.
|
|
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
|
/// Block type.
|
|
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
|
/// Block ID.
|
|
pub type BlockId = generic::BlockId<Block>;
|
|
|
|
/// Opaque, encoded, unchecked extrinsic.
|
|
pub type UncheckedExtrinsic = OpaqueExtrinsic;
|