-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add parachains-common-types #10513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add parachains-common-types #10513
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2741ba2
add parachains-common-types
xlc 220a545
add copyright header
xlc d6b28d9
Update from github-actions[bot] running command 'prdoc'
github-actions[bot] 58a8179
udpate pr doc
xlc 802a8fb
Update from github-actions[bot] running command 'fmt'
github-actions[bot] 7481c25
Merge branch 'master' into parachains-common-types
xlc 0ac91e3
update crate bump
xlc 727ab6d
update umbrella
xlc b8cbd91
update
xlc 5e41a2f
update
xlc a46a327
Merge branch 'master' into parachains-common-types
iulianbarbu 749056a
Merge branch 'master' into parachains-common-types
iulianbarbu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| [package] | ||
| name = "parachains-common-types" | ||
| version = "0.1.0" | ||
| authors.workspace = true | ||
| edition.workspace = true | ||
| description = "Common types for parachains" | ||
| license = "Apache-2.0" | ||
| homepage.workspace = true | ||
| repository.workspace = true | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [dependencies] | ||
| sp-consensus-aura = { workspace = true } | ||
| sp-core = { workspace = true } | ||
| sp-runtime = { workspace = true } | ||
|
|
||
| [features] | ||
| default = ["std"] | ||
| std = [ | ||
| "sp-consensus-aura/std", | ||
| "sp-core/std", | ||
| "sp-runtime/std", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // Copyright (C) Parity Technologies (UK) Ltd. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #![cfg_attr(not(feature = "std"), no_std)] | ||
|
|
||
| pub mod opaque; | ||
|
|
||
| use sp_runtime::traits::{IdentifyAccount, Verify}; | ||
|
|
||
| /// 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 = sp_runtime::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 Nonce = u32; | ||
|
|
||
| /// A hash of some data used by the chain. | ||
| pub type Hash = sp_core::H256; | ||
|
|
||
| /// Digest item type. | ||
| pub type DigestItem = sp_runtime::generic::DigestItem; | ||
|
|
||
| // Aura consensus authority. | ||
| pub type AuraId = sp_consensus_aura::sr25519::AuthorityId; | ||
|
|
||
| // Aura consensus authority used by Asset Hub Polkadot. | ||
| // | ||
| // Because of registering the authorities with an ed25519 key before switching from Shell | ||
| // to Asset Hub Polkadot, we were required to deploy a hotfix that changed Asset Hub Polkadot's | ||
| // Aura keys to ed22519. In the future that may change again. | ||
| pub type AssetHubPolkadotAuraId = sp_consensus_aura::ed25519::AuthorityId; | ||
|
|
||
| // Id used for identifying assets. | ||
| pub type AssetIdForTrustBackedAssets = u32; | ||
|
|
||
| // Id used for identifying non-fungible collections. | ||
| pub type CollectionId = u32; | ||
|
|
||
| // Id used for identifying non-fungible items. | ||
| pub type ItemId = u32; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Copyright (C) Parity Technologies (UK) Ltd. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| use super::*; | ||
| use sp_runtime::{generic, traits::BlakeTwo256}; | ||
|
|
||
| pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; | ||
| /// Opaque block header type. | ||
| pub type Header = generic::Header<BlockNumber, BlakeTwo256>; | ||
| /// Opaque block type. | ||
| pub type Block = generic::Block<Header, UncheckedExtrinsic>; | ||
| /// Opaque block identifier type. | ||
| pub type BlockId = generic::BlockId<Block>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| title: Extract parachain types into a dedicated crate | ||
| doc: | ||
| - audience: Node Dev | ||
| description: |- | ||
| Closes https://github.com/paritytech/polkadot-sdk/issues/10512. | ||
|
|
||
| Moves the common parachain primitives (accounts, balances, hashes, opaque block types) into a new `parachains-common-types` crate. The existing `parachains-common` crate re-exports these definitions, and `polkadot-omni-node-lib` now depends on the lightweight types crate to avoid pulling runtime pallets into omni-node builds. | ||
| crates: | ||
| - name: parachains-common | ||
| bump: major | ||
| - name: parachains-common-types | ||
| bump: major | ||
| - name: polkadot-omni-node-lib | ||
| bump: patch | ||
| - name: polkadot-sdk | ||
| bump: minor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.