-
Notifications
You must be signed in to change notification settings - Fork 53
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
Polkadot v1.6.0 upgrade #413
Merged
Merged
Changes from 18 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
9ab7d7c
Simple template compiles
fgamundi 3ef4d8f
Simple template cleanup
fgamundi d8c9bcd
Simple template chainspec
fgamundi ac5fea8
Complete build green
fgamundi 35cf56c
fmt
fgamundi e2c616b
Fix deps
fgamundi 0f3297b
Tests builds
fgamundi fc012bb
impl GenesisBuilder
fgamundi 07b1d11
Updated polkadot-sdk commit
fgamundi e32171e
Missing deps
fgamundi 766140f
Unit tests ok!
fgamundi 8b1003f
bring serde regardless of std feature
girazoki fea9133
api-augment
fgamundi 0ee0a6e
Fix container chain chain spec using set_storage
tmpolaczyk bbcbecc
Merge branch 'master' into fg/polkadot-v1.6.0
fgamundi 36274a4
Merge branch 'master' into fg/polkadot-v1.6.0
fgamundi d9e272a
Fix frontier node and identity tests
fgamundi 9125148
Fix xcm tests for message queue
fgamundi 1121930
use build_storage from emulated_integration_tests
girazoki 98ec012
Merge branch 'master' into fg/polkadot-v1.6.0
fgamundi d027f6c
fmt
fgamundi e44ca0f
Update moonkit ref
fgamundi 1b75b68
try-runtime builds
fgamundi ce7ae5c
Ts lint
fgamundi 30fd8cd
toml maid
fgamundi f35ea5d
merge
girazoki fdc1a26
fix runtime-benchmarks compilation
girazoki 8e3ece1
try-runtime to pallet-balances
girazoki e1ea242
XcmpQueue migrations
fgamundi 33f74cd
Migrations
fgamundi e4c461f
try-runtime
fgamundi e59d5cb
zepter
fgamundi a66e937
toml-maid
fgamundi 4dfe83e
Review
fgamundi bb99085
Merge remote-tracking branch 'origin/master' into fg/polkadot-v1.6.0
fgamundi d5f17a5
try runtime subcommand
fgamundi e6ba443
MessageQueueServiceWeight to 25%
fgamundi b60d095
Unused import
fgamundi 017af80
Fix clippy
fgamundi 9e058e4
increase sleep time for first block in parathread
girazoki c2fe33c
be a bit more mindful about times in parachains
girazoki 98fd437
increment even more timeout
girazoki 4b534dc
Formatting and API augment
fgamundi 34f4c04
Update forks refs
fgamundi c538141
Merge branch 'master' into fg/polkadot-v1.6.0
fgamundi 2e91399
Increase grcov version in coverage
fgamundi e412943
Remove ignores from coverage
fgamundi 917d08a
Remove ignores from coverage
fgamundi 996d4a8
Revert coverage changes
fgamundi 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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,58 @@ | ||
// Copyright (C) Moondance Labs Ltd. | ||
// This file is part of Tanssi. | ||
|
||
// Tanssi 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. | ||
|
||
// Tanssi 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 Tanssi. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
use parity_scale_codec::Encode; | ||
use sc_chain_spec::ChainSpec; | ||
use sp_runtime::{ | ||
traits::{Block as BlockT, Hash as HashT, Header as HeaderT, Zero}, | ||
StateVersion, | ||
}; | ||
|
||
/// Generate the genesis block from a given ChainSpec. | ||
pub fn generate_genesis_block<Block: BlockT>( | ||
chain_spec: &dyn ChainSpec, | ||
genesis_state_version: StateVersion, | ||
) -> Result<Block, String> { | ||
let storage = chain_spec.build_storage()?; | ||
|
||
let child_roots = storage.children_default.iter().map(|(sk, child_content)| { | ||
let state_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root( | ||
child_content.data.clone().into_iter().collect(), | ||
genesis_state_version, | ||
); | ||
(sk.clone(), state_root.encode()) | ||
}); | ||
let state_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root( | ||
storage.top.clone().into_iter().chain(child_roots).collect(), | ||
genesis_state_version, | ||
); | ||
|
||
let extrinsics_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root( | ||
Vec::new(), | ||
genesis_state_version, | ||
); | ||
|
||
Ok(Block::new( | ||
<<Block as BlockT>::Header as HeaderT>::new( | ||
Zero::zero(), | ||
extrinsics_root, | ||
state_root, | ||
Default::default(), | ||
Default::default(), | ||
), | ||
Default::default(), | ||
)) | ||
} |
This file contains 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 |
---|---|---|
|
@@ -15,3 +15,5 @@ | |
// along with Tanssi. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
pub mod service; | ||
|
||
pub mod command; |
This file contains 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 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn it, I hate that they keep changing this part of the code