referrerpolicy=no-referrer-when-downgrade

parachains_common_types/
lib.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// SPDX-License-Identifier: Apache-2.0
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// 	http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#![cfg_attr(not(feature = "std"), no_std)]
17
18pub mod opaque;
19
20use sp_runtime::traits::{IdentifyAccount, Verify};
21
22/// An index to a block.
23pub type BlockNumber = u32;
24
25/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.
26pub type Signature = sp_runtime::MultiSignature;
27
28/// Some way of identifying an account on the chain. We intentionally make it equivalent
29/// to the public key of our transaction signing scheme.
30pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;
31
32/// The type for looking up accounts. We don't expect more than 4 billion of them, but you
33/// never know...
34pub type AccountIndex = u32;
35
36/// Balance of an account.
37pub type Balance = u128;
38
39/// Index of a transaction in the chain.
40pub type Nonce = u32;
41
42/// A hash of some data used by the chain.
43pub type Hash = sp_core::H256;
44
45/// Digest item type.
46pub type DigestItem = sp_runtime::generic::DigestItem;
47
48// Aura consensus authority.
49pub type AuraId = sp_consensus_aura::sr25519::AuthorityId;
50
51// Aura consensus authority used by Asset Hub Polkadot.
52//
53// Because of registering the authorities with an ed25519 key before switching from Shell
54// to Asset Hub Polkadot, we were required to deploy a hotfix that changed Asset Hub Polkadot's
55// Aura keys to ed22519. In the future that may change again.
56pub type AssetHubPolkadotAuraId = sp_consensus_aura::ed25519::AuthorityId;
57
58// Id used for identifying assets.
59pub type AssetIdForTrustBackedAssets = u32;
60
61// Id used for identifying non-fungible collections.
62pub type CollectionId = u32;
63
64// Id used for identifying non-fungible items.
65pub type ItemId = u32;