This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial commit Forked at: 5bbab68 Parent branch: origin/master * Copy runtime module from rococo Forked at: 5bbab68 Parent branch: origin/master * Also copy dependencies pallets and primitives Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * test-service * Move integration test * CLEANUP Forked at: 5bbab68 Parent branch: origin/master * Not sure what went wrong... * WIP Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * CLEANUP Forked at: 5bbab68 Parent branch: origin/master * fmt * CLEANUP Forked at: 5bbab68 Parent branch: origin/master * CLEANUP Forked at: 5bbab68 Parent branch: origin/master * Remove pallet contracts (not used) * Remove pallet parachain-info and token-dealer (not used) * Sort dependencies alphabetically * CLEANUP Forked at: 5bbab68 Parent branch: origin/master * CumulusTestNode for testing * Speed up block generation * Fix improper shutdown * rustfmt * runtime: replace const by storage * Fix for previous commit * Remove some generics * Move generate_genesis_state to cumulus-primitives * fmt * Remove message_example * fixup! Remove message_example * WIP Forked at: 5bbab68 Parent branch: origin/master * Half the solution to previous commit :( * Revert "Fix for previous commit" This reverts commit 60010ba. * Revert "runtime: replace const by storage" This reverts commit c64b3a4. Not working for some reason... * Use helper Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * Remove test-primitives * Revert "Half the solution to previous commit :(" This reverts commit 9a8f89f. * Revert "Revert "Half the solution to previous commit :("" This reverts commit 6a93f0f. * Test with some extra extrinsics * WIP Forked at: 5bbab68 Parent branch: origin/master * CLEANUP Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * WIP Forked at: 5bbab68 Parent branch: origin/master * CLEANUP Forked at: 5bbab68 Parent branch: origin/master * Remove message broker
- Loading branch information
Showing
24 changed files
with
1,956 additions
and
869 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ members = [ | |
"service", | ||
"test/runtime", | ||
"test/client", | ||
"test/service", | ||
"upward-message", | ||
] | ||
|
||
|
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,50 @@ | ||
// Copyright 2020 Parity Technologies (UK) Ltd. | ||
// This file is part of Cumulus. | ||
|
||
// Cumulus 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. | ||
|
||
// Cumulus 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 Cumulus. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
use codec::Encode; | ||
use sc_service::ChainSpec; | ||
use sp_runtime::traits::{Block as BlockT, Hash as HashT, Header as HeaderT, Zero}; | ||
|
||
/// Generate the genesis state for a given ChainSpec. | ||
pub fn generate_genesis_block<Block: BlockT>( | ||
chain_spec: &Box<dyn ChainSpec>, | ||
) -> 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(), | ||
); | ||
(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(), | ||
); | ||
|
||
let extrinsics_root = | ||
<<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(Vec::new()); | ||
|
||
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
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.