Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
2383ba9
Amalgamate pieces of balance module
gavofyork Jan 20, 2020
62023ac
Merge branch 'master' of github.com:paritytech/polkadot
gavofyork Jan 22, 2020
e4065cb
Fixes for vesting split
gavofyork Jan 22, 2020
f7d05c8
Refactoring for vesting/balances split
gavofyork Jan 22, 2020
372908d
Build fixes
gavofyork Jan 23, 2020
f9b2b2f
Remove on_free_balance_zero and some docs.
gavofyork Jan 23, 2020
c51f4d7
Indentation.
gavofyork Jan 29, 2020
84ed49c
Merge branch 'gav-split-balanecs-vesting' into gav-upsub
gavofyork Feb 1, 2020
94b9d10
Revert branch
gavofyork Feb 1, 2020
d7b44ec
Fix.
gavofyork Feb 2, 2020
4013a30
Update substrate: fixes after CLI refactoring
cecton Feb 4, 2020
830f819
Merge branch 'master' into gav-upsub
rphmeier Feb 5, 2020
b5f436a
Reverting removal of exit
cecton Feb 6, 2020
1df7547
Removed too much again
cecton Feb 6, 2020
7916135
Update Cargo.lock
cecton Feb 6, 2020
96a0c87
Cargo.lock
cecton Feb 7, 2020
a1f25b4
Update Substrate, ready for #4820
gavofyork Feb 7, 2020
bebc910
Merge branch 'gav-upsub' of github.com:paritytech/polkadot into gav-u…
gavofyork Feb 7, 2020
6b05cb4
Fixes
gavofyork Feb 7, 2020
bffee5e
Merge remote-tracking branch 'origin/cecton-cli-refactoring-more' int…
bkchr Feb 8, 2020
3441e24
Merge remote-tracking branch 'origin/cecton-cli-refactoring-more' int…
gavofyork Feb 8, 2020
142b9c9
Merge branch 'gav-upsub' of github.com:paritytech/polkadot into gav-u…
gavofyork Feb 8, 2020
09e6236
Update to latest substrate master
bkchr Feb 8, 2020
691c6c3
Fix network tests
bkchr Feb 8, 2020
e710b5b
Changes needed for substrate/#4820
gavofyork Feb 8, 2020
7f7ce20
Remove StaticLookup
gavofyork Feb 8, 2020
c563e9d
Bump version to 0.7.21
gavofyork Feb 8, 2020
ab23e94
rename uses of StorageMap::exists(key) to ::contains_key(key)
apopiak Feb 7, 2020
587a1fd
use substrate PR branch
apopiak Feb 7, 2020
e124686
adjust impl_version according to substrate change
apopiak Feb 7, 2020
8ab4509
update Cargo.lock
apopiak Feb 7, 2020
9239d7e
use master branch instead of PR branch
apopiak Feb 10, 2020
a616423
Revert "use master branch instead of PR branch"
apopiak Feb 10, 2020
cdacb01
Style
gavofyork Feb 10, 2020
a068b4a
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 10, 2020
b3f98cd
Merge remote-tracking branch 'origin/apopiak-rename-exists-to-contain…
gavofyork Feb 10, 2020
f9e41fb
Fix tests
gavofyork Feb 10, 2020
8586c90
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 10, 2020
770e0e6
Update lock
gavofyork Feb 10, 2020
3aaaab3
Update to use correct hash
gavofyork Feb 10, 2020
7ed3a51
Bump spec_version for polkadot runtime
jacogr Feb 11, 2020
2355515
Tidying it up.
gavofyork Feb 13, 2020
06f5595
Merge branch 'gav-composite-account' of github.com:paritytech/polkado…
gavofyork Feb 13, 2020
4be0cbc
Merge remote-tracking branch 'origin/master' into gav-composite-account
bkchr Feb 15, 2020
335d0de
*: Ensure GossipEngine is being polled
mxinden Feb 11, 2020
9e1f576
Update to latest Substrate master
bkchr Feb 15, 2020
a5c02b6
Merge remote-tracking branch 'origin/master' into gav-composite-account
bkchr Feb 15, 2020
ac69c83
Bump spec_version for polkadot runtime
jacogr Feb 15, 2020
5dcf527
patch
cheme Feb 17, 2020
53e798a
Merge branch '834' into w3
cheme Feb 17, 2020
430ca61
update
cheme Feb 18, 2020
b934ede
Merge branch 'master' into w3
cheme Mar 26, 2020
6b35405
Merge branch 'master' into w3
cheme Mar 26, 2020
141efde
update to latest branch
cheme Mar 26, 2020
ebfccc9
Update head
cheme Mar 26, 2020
afb0fb4
Merge branch 'master' into w3
cheme Mar 30, 2020
159e6a2
remove patch
cheme Mar 30, 2020
917f96d
Merge branch 'master' into w3
cheme Apr 2, 2020
ee39343
Merge branch 'master' into w3
cheme Apr 9, 2020
b226f58
Merge branch 'master' into w3
cheme Apr 14, 2020
2a902c8
Merge branch 'master' into w3
cheme Apr 15, 2020
0924fa0
prometheus registry to txpool
NikVolf Apr 16, 2020
65e9d43
Merge remote-tracking branch 'origin/master' into nv-txpool-prometheus
NikVolf Apr 17, 2020
97d3ed5
update substrate
NikVolf Apr 17, 2020
8ffefe4
Merge branch 'master' into w3
cheme Apr 17, 2020
5f7a496
Merge branch '1003' into w3
cheme Apr 17, 2020
616446b
Merge branch 'master' into w3
cheme Apr 20, 2020
4c65314
update cargo lock
cheme Apr 20, 2020
faf4e3d
bump spec versions
cheme Apr 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 158 additions & 127 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions parachain/src/wasm_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use std::any::{TypeId, Any};
use crate::primitives::{ValidationParams, ValidationResult, UpwardMessage};
use codec::{Decode, Encode};
use sp_core::storage::{ChildStorageKey, ChildInfo};
use sp_core::storage::ChildInfo;
use sp_core::traits::CallInWasm;
use sp_wasm_interface::HostFunctions as _;

Expand Down Expand Up @@ -205,31 +205,31 @@ impl sp_externalities::Externalities for ValidationExternalities {
panic!("storage_hash: unsupported feature for parachain validation")
}

fn child_storage_hash(&self, _: ChildStorageKey, _: ChildInfo, _: &[u8]) -> Option<Vec<u8>> {
fn child_storage_hash(&self, _: &ChildInfo, _: &[u8]) -> Option<Vec<u8>> {
panic!("child_storage_hash: unsupported feature for parachain validation")
}

fn child_storage(&self, _: ChildStorageKey, _: ChildInfo, _: &[u8]) -> Option<Vec<u8>> {
fn child_storage(&self, _: &ChildInfo, _: &[u8]) -> Option<Vec<u8>> {
panic!("child_storage: unsupported feature for parachain validation")
}

fn kill_child_storage(&mut self, _: ChildStorageKey, _: ChildInfo) {
fn kill_child_storage(&mut self, _: &ChildInfo) {
panic!("kill_child_storage: unsupported feature for parachain validation")
}

fn clear_prefix(&mut self, _: &[u8]) {
panic!("clear_prefix: unsupported feature for parachain validation")
}

fn clear_child_prefix(&mut self, _: ChildStorageKey, _: ChildInfo, _: &[u8]) {
fn clear_child_prefix(&mut self, _: &ChildInfo, _: &[u8]) {
panic!("clear_child_prefix: unsupported feature for parachain validation")
}

fn place_storage(&mut self, _: Vec<u8>, _: Option<Vec<u8>>) {
panic!("place_storage: unsupported feature for parachain validation")
}

fn place_child_storage(&mut self, _: ChildStorageKey, _: ChildInfo, _: Vec<u8>, _: Option<Vec<u8>>) {
fn place_child_storage(&mut self, _: &ChildInfo, _: Vec<u8>, _: Option<Vec<u8>>) {
panic!("place_child_storage: unsupported feature for parachain validation")
}

Expand All @@ -241,15 +241,15 @@ impl sp_externalities::Externalities for ValidationExternalities {
panic!("storage_root: unsupported feature for parachain validation")
}

fn child_storage_root(&mut self, _: ChildStorageKey) -> Vec<u8> {
fn child_storage_root(&mut self, _: &ChildInfo) -> Vec<u8> {
panic!("child_storage_root: unsupported feature for parachain validation")
}

fn storage_changes_root(&mut self, _: &[u8]) -> Result<Option<Vec<u8>>, ()> {
panic!("storage_changes_root: unsupported feature for parachain validation")
}

fn next_child_storage_key(&self, _: ChildStorageKey, _: ChildInfo, _: &[u8]) -> Option<Vec<u8>> {
fn next_child_storage_key(&self, _: &ChildInfo, _: &[u8]) -> Option<Vec<u8>> {
panic!("next_child_storage_key: unsupported feature for parachain validation")
}

Expand Down
29 changes: 6 additions & 23 deletions runtime/common/src/crowdfund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ use sp_runtime::{ModuleId,
use crate::slots;
use codec::{Encode, Decode};
use sp_std::vec::Vec;
use sp_core::storage::well_known_keys::CHILD_STORAGE_KEY_PREFIX;
use primitives::parachain::{Id as ParaId, HeadData};

const MODULE_ID: ModuleId = ModuleId(*b"py/cfund");
Expand Down Expand Up @@ -529,46 +528,30 @@ impl<T: Trait> Module<T> {
MODULE_ID.into_sub_account(index)
}

pub fn id_from_index(index: FundIndex) -> Vec<u8> {
pub fn id_from_index(index: FundIndex) -> child::ChildInfo {
let mut buf = Vec::new();
buf.extend_from_slice(b"crowdfund");
buf.extend_from_slice(&index.to_le_bytes()[..]);

CHILD_STORAGE_KEY_PREFIX.into_iter()
.chain(b"default:")
.chain(T::Hashing::hash(&buf[..]).as_ref().into_iter())
.cloned()
.collect()
}

/// Child trie unique id for a crowdfund is built from the hash part of the fund id.
pub fn trie_unique_id(fund_id: &[u8]) -> child::ChildInfo {
let start = CHILD_STORAGE_KEY_PREFIX.len() + b"default:".len();
child::ChildInfo::new_default(&fund_id[start..])
child::ChildInfo::new_default(T::Hashing::hash(&buf[..]).as_ref())
}

pub fn contribution_put(index: FundIndex, who: &T::AccountId, balance: &BalanceOf<T>) {
let id = Self::id_from_index(index);
who.using_encoded(|b| child::put(id.as_ref(), Self::trie_unique_id(id.as_ref()), b, balance));
who.using_encoded(|b| child::put(&Self::id_from_index(index), b, balance));
}

pub fn contribution_get(index: FundIndex, who: &T::AccountId) -> BalanceOf<T> {
let id = Self::id_from_index(index);
who.using_encoded(|b| child::get_or_default::<BalanceOf<T>>(
id.as_ref(),
Self::trie_unique_id(id.as_ref()),
&Self::id_from_index(index),
b,
))
}

pub fn contribution_kill(index: FundIndex, who: &T::AccountId) {
let id = Self::id_from_index(index);
who.using_encoded(|b| child::kill(id.as_ref(), Self::trie_unique_id(id.as_ref()), b));
who.using_encoded(|b| child::kill(&Self::id_from_index(index), b));
}

pub fn crowdfund_kill(index: FundIndex) {
let id = Self::id_from_index(index);
child::kill_storage(id.as_ref(), Self::trie_unique_id(id.as_ref()));
child::kill_storage(&Self::id_from_index(index));
}
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1058,
spec_version: 1059,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
2 changes: 1 addition & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot"),
impl_name: create_runtime_str!("parity-polkadot"),
authoring_version: 2,
spec_version: 1007,
spec_version: 1008,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
4 changes: 2 additions & 2 deletions runtime/test-runtime/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl substrate_test_client::GenesisInit for GenesisParameters {

let mut storage = self.genesis_config().genesis_map();

let child_roots = storage.children.iter().map(|(sk, child_content)| {
let child_roots = storage.children_default.iter().map(|(sk, child_content)| {
let state_root = <<<runtime::Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
child_content.data.clone().into_iter().collect()
);
Expand Down Expand Up @@ -198,7 +198,7 @@ pub trait TestClientBuilderExt<B>: Sized {
let key = key.into();
assert!(!storage_key.is_empty());
assert!(!key.is_empty());
self.genesis_init_mut().extra_storage.children
self.genesis_init_mut().extra_storage.children_default
.entry(storage_key)
.or_insert_with(|| StorageChild {
data: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot-test-runtime"),
impl_name: create_runtime_str!("parity-polkadot-test-runtime"),
authoring_version: 2,
spec_version: 1050,
spec_version: 1051,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
2 changes: 1 addition & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westend"),
impl_name: create_runtime_str!("parity-westend"),
authoring_version: 2,
spec_version: 3,
spec_version: 4,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down