Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
bc0dd14
Upgrade pallet token-mint to the latest Substrate version.
shamil-gadelshin Jul 14, 2020
d8bc659
runtime: Upgrade recurring reward module.
shamil-gadelshin Jul 15, 2020
e1010a0
runtime: Upgrade ‘common’ pallet.
shamil-gadelshin Jul 15, 2020
f4e964a
runtime: Upgrade the ‘memo’ pallet.
shamil-gadelshin Jul 16, 2020
45cb5c0
runtime: Add ‘adjust weight’ comment.
shamil-gadelshin Jul 16, 2020
d19453a
runtime: Upgrace ‘version-store’ pallet.
shamil-gadelshin Jul 16, 2020
580566a
runtime: Clear pallets dependencies.
shamil-gadelshin Jul 16, 2020
14970f3
runtime: Upgrade the ‘versioned-store-permissions’ pallet.
shamil-gadelshin Jul 16, 2020
5daaca2
runtime: Upgrade the ‘stake’ pallet.
shamil-gadelshin Jul 16, 2020
654fa04
runtime: Upgrade the ‘hiring’ pallet.
shamil-gadelshin Jul 16, 2020
2902739
Merge branch 'iznik' into migrate_runtime_module1
shamil-gadelshin Jul 20, 2020
acd378a
runtime: Upgrade the memberhip pallet.
shamil-gadelshin Jul 20, 2020
76e5b2b
runtime: Update the ‘mockall’ dependency.
shamil-gadelshin Jul 20, 2020
ee13b23
runtime: Remove unused dependencies in the membership pallet.
shamil-gadelshin Jul 20, 2020
11d0e82
runtime: Upgrade forum pallet.
shamil-gadelshin Jul 21, 2020
0a3edf3
runtime: Upgrade governance pallet.
shamil-gadelshin Jul 21, 2020
0443993
runtime: Upgrade the content-working group pallet.
shamil-gadelshin Jul 22, 2020
5663eef
runtime: Convert working-group lib and errors.
shamil-gadelshin Jul 22, 2020
d2f8283
runtime: Upgrade working-group pallet tests.
shamil-gadelshin Jul 22, 2020
1b734fb
runtime: Upgrade the ‘storage’ pallet.
shamil-gadelshin Jul 22, 2020
60d672d
runtime: Upgrade ‘service-discovery’ pallet.
shamil-gadelshin Jul 22, 2020
37a9008
runtime: Remove ‘*’ reference from the ‘use’ clauses.
shamil-gadelshin Jul 22, 2020
8977b62
runtime: Upgrade proposals engine pallet (without tests).
shamil-gadelshin Jul 23, 2020
3ea6217
runtime: Upgrade proposals engine pallet - restore tests.
shamil-gadelshin Jul 23, 2020
aa8d5ed
runtime: Upgrade the discussion pallet.
shamil-gadelshin Jul 23, 2020
08f7a20
runtime: Upgrade codex pallet.
shamil-gadelshin Jul 23, 2020
25143d2
runtime: Upgrade the runtime crate (successful compilation).
shamil-gadelshin Jul 24, 2020
d87f5c3
runtime: Refactor runtime Cargo.toml
shamil-gadelshin Jul 24, 2020
a6ce032
runtime: Migrate runtime tests.
shamil-gadelshin Jul 26, 2020
6839472
runtime: Restore tests.
shamil-gadelshin Jul 28, 2020
75873ec
runtime: Fix broken tests.
shamil-gadelshin Jul 28, 2020
c1e2105
runtime: Update runtime pallet dependencies.
shamil-gadelshin Jul 28, 2020
5f30beb
runtime: Rename rstd to sp_std.
shamil-gadelshin Jul 28, 2020
e5f7759
runtime: Rename timestamp to pallet_timestamp
shamil-gadelshin Jul 28, 2020
02faae0
runtime: Apply rust fmt.
shamil-gadelshin Jul 29, 2020
e7c5ea0
runtime: Move out the integration logic outside the runtime lib.rs
shamil-gadelshin Jul 29, 2020
6396810
runtime: Update runtime dependencies.
shamil-gadelshin Jul 29, 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
6,042 changes: 1,878 additions & 4,164 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ members = [
"runtime-modules/versioned-store",
"runtime-modules/versioned-store-permissions",
"runtime-modules/working-group",
"node",
"utils/chain-spec-builder/"
# "node",
# "utils/chain-spec-builder/"
]

[profile.release]
Expand Down
58 changes: 15 additions & 43 deletions runtime-modules/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,52 +1,24 @@
[package]
name = 'substrate-common-module'
version = '1.2.0'
name = 'pallet-common'
version = '3.0.0'
authors = ['Joystream contributors']
edition = '2018'

[dependencies]
serde = { version = "1.0.101", optional = true, features = ["derive"] }
codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}

[features]
default = ['std']
std = [
'sr-primitives/std',
'srml-support/std',
'system/std',
'timestamp/std',
'serde',
'codec/std',
'serde'
'sp-runtime/std',
'frame-support/std',
'system/std',
'pallet-timestamp/std',
]


[dependencies.sr-primitives]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'sr-primitives'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.srml-support]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-support'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.system]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-system'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.codec]
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '1.0.0'

[dependencies.serde]
features = ['derive']
optional = true
version = '1.0.101'

[dependencies.timestamp]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-timestamp'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'
4 changes: 2 additions & 2 deletions runtime-modules/common/src/currency.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use sr_primitives::traits::Convert;
use srml_support::traits::{Currency, LockableCurrency, ReservableCurrency};
use frame_support::traits::{Currency, LockableCurrency, ReservableCurrency};
use sp_runtime::traits::Convert;

pub trait GovernanceCurrency: system::Trait + Sized {
type Currency: Currency<Self::AccountId>
Expand Down
4 changes: 2 additions & 2 deletions runtime-modules/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ pub struct BlockAndTime<BlockNumber, Moment> {
/// Gathers current block and time information for the runtime.
/// If this function is used inside a config() at genesis the timestamp will be 0
/// because the timestamp is actually produced by validators.
pub fn current_block_time<T: system::Trait + timestamp::Trait>(
pub fn current_block_time<T: system::Trait + pallet_timestamp::Trait>(
) -> BlockAndTime<T::BlockNumber, T::Moment> {
BlockAndTime {
block: <system::Module<T>>::block_number(),
time: <timestamp::Module<T>>::now(),
time: <pallet_timestamp::Module<T>>::now(),
}
}
157 changes: 37 additions & 120 deletions runtime-modules/content-working-group/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,131 +1,48 @@
[package]
name = 'substrate-content-working-group-module'
version = '1.1.0'
name = 'pallet-content-working-group'
version = '3.0.0'
authors = ['Joystream contributors']
edition = '2018'

[dependencies]
serde = { version = "1.0.101", optional = true, features = ["derive"] }
codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
membership = { package = 'pallet-membership', default-features = false, path = '../membership'}
stake = { package = 'pallet-stake', default-features = false, path = '../stake'}
hiring = { package = 'pallet-hiring', default-features = false, path = '../hiring'}
minting = { package = 'pallet-token-mint', default-features = false, path = '../token-minting'}
recurringrewards = { package = 'pallet-recurring-reward', default-features = false, path = '../recurring-reward'}
versioned_store = { package = 'pallet-versioned-store', default-features = false, path = '../versioned-store'}
versioned_store_permissions = { package = 'pallet-versioned-store-permissions', default-features = false, path = '../versioned-store-permissions'}
common = { package = 'pallet-common', default-features = false, path = '../common'}

[dev-dependencies]
sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}

[features]
default = ['std']
std = [
'sr-primitives/std',
'srml-support/std',
'serde',
'codec/std',
'sp-std/std',
'frame-support/std',
'system/std',
'serde',
'codec/std',
'primitives/std',
'rstd/std',
'membership/std',
'forum/std',
'hiring/std',
'stake/std',
'minting/std',
'sp-arithmetic/std',
'sp-runtime/std',
'membership/std',
'stake/std',
'hiring/std',
'minting/std',
'recurringrewards/std',
'versioned_store/std',
'versioned_store_permissions/std',
'recurringrewards/std',
'common/std',
'common/std',
]


[dependencies.sr-primitives]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'sr-primitives'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.srml-support]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-support'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.system]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-system'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.rstd]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'sr-std'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.serde]
features = ['derive']
optional = true
version = '1.0.101'

[dependencies.primitives]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-primitives'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.codec]
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '1.0.0'

[dependencies.forum]
default_features = false
package = 'substrate-forum-module'
path = '../forum'

[dependencies.minting]
default_features = false
package = 'substrate-token-mint-module'
path = '../token-minting'

[dependencies.stake]
default_features = false
package = 'substrate-stake-module'
path = '../stake'

[dependencies.recurringrewards]
default_features = false
package = 'substrate-recurring-reward-module'
path = '../recurring-reward'

[dependencies.hiring]
default_features = false
package = 'substrate-hiring-module'
path = '../hiring'

[dependencies.versioned_store]
default_features = false
package ='substrate-versioned-store'
path = '../versioned-store'

[dependencies.versioned_store_permissions]
default_features = false
package = 'substrate-versioned-store-permissions-module'
path = '../versioned-store-permissions'

[dependencies.membership]
default_features = false
package = 'substrate-membership-module'
path = '../membership'

[dependencies.common]
default_features = false
package = 'substrate-common-module'
path = '../common'

[dev-dependencies.runtime-io]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'sr-io'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dev-dependencies.balances]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-balances'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dev-dependencies.timestamp]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-timestamp'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'
62 changes: 2 additions & 60 deletions runtime-modules/content-working-group/src/genesis.rs
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
#![cfg(test)]

use crate::{Trait, *};
pub use primitives::{map, Blake2Hasher, H256};
use rstd::prelude::*;
use sp_std::map;

/// DIRTY IMPORT BECAUSE
/// InputValidationLengthConstraint has not been factored out yet!!!
use common::constraints::InputValidationLengthConstraint;

/// The way a map (linked_map) is represented in the GenesisConfig produced by decl_storage
//pub type GenesisConfigMap<K, V> = std::vec::Vec<(K, V)>;

/// Builder of genesis configuration of content working group.
pub struct GenesisConfigBuilder<T: Trait> {
mint_capacity: minting::BalanceOf<T>,
/*
lead_by_id: GenesisConfigMap<LeadId<T>, Lead<T::AccountId, T::RewardRelationshipId, T::BlockNumber>>,
next_lead_id: LeadId<T>,
curator_opening_by_id: GenesisConfigMap<CuratorOpeningId<T>, CuratorOpening<T::OpeningId, T::BlockNumber, BalanceOf<T>, CuratorApplicationId<T>>>,
next_curator_opening_id: CuratorOpeningId<T>,
curator_application_by_id: GenesisConfigMap<CuratorApplicationId<T>, CuratorApplication<T::AccountId, CuratorOpeningId<T>, T::MemberId, T::ApplicationId>>,
next_curator_application_id: CuratorApplicationId<T>,
channel_by_id: GenesisConfigMap<ChannelId<T>, Channel<T::MemberId, T::AccountId, T::BlockNumber, PrincipalId<T>>>,
next_channel_id: ChannelId<T>,
channel_id_by_handle: GenesisConfigMap<Vec<u8>, ChannelId<T>>,
curator_by_id: GenesisConfigMap<CuratorId<T>, Curator<T::AccountId, T::RewardRelationshipId, T::StakeId, T::BlockNumber, LeadId<T>, CuratorApplicationId<T>, PrincipalId<T>>>,
next_curator_id: CuratorId<T>,
principal_by_id: GenesisConfigMap<PrincipalId<T>, Principal<CuratorId<T>, ChannelId<T>>>,
next_principal_id: PrincipalId<T>,

unstaker_by_stake_id: GenesisConfigMap<TestStakeId, WorkingGroupUnstaker<LeadId<T>, CuratorId<T>>>,
*/
channel_creation_enabled: bool,
channel_handle_constraint: InputValidationLengthConstraint,
channel_description_constraint: InputValidationLengthConstraint,
Expand All @@ -47,28 +24,14 @@ impl<T: Trait> GenesisConfigBuilder<T> {
self.mint_capacity = capacity;
self
}
/*
pub fn set_channel_handle_constraint(mut self, constraint: InputValidationLengthConstraint) -> Self {
self.channel_description_constraint = constraint;
self
}
pub fn set_channel_description_constraint(mut self, constraint: InputValidationLengthConstraint) -> Self {
self.channel_description_constraint = constraint;
self
}
pub fn set_channel_creation_enabled(mut self, channel_creation_enabled: bool) -> Self {
self.channel_creation_enabled = channel_creation_enabled;
self
}
*/

pub fn build(self) -> GenesisConfig<T> {
GenesisConfig {
mint_capacity: self.mint_capacity,
curator_opening_by_id: map![], //GenesisConfigMap<CuratorOpeningId, Opening>,
next_curator_opening_id: CuratorOpeningId::<T>::default(),
curator_application_by_id: map![], //GenesisConfigMap<CuratorApplicationId,CuratorApplication>,
next_curator_application_id: CuratorApplicationId::<T>::default(),

channel_by_id: map![], //GenesisConfigMap<ChannelId, Channel>,
next_channel_id: ChannelId::<T>::default(),
channel_id_by_handle: map![], //GenesisConfigMap<Vec<u8>, ChannelId>,
Expand All @@ -78,12 +41,10 @@ impl<T: Trait> GenesisConfigBuilder<T> {
next_principal_id: PrincipalId::<T>::default(),
channel_creation_enabled: self.channel_creation_enabled,
unstaker_by_stake_id: map![], //GenesisConfigMap<LeadId, CuratorId>,

channel_handle_constraint: self.channel_handle_constraint,
channel_description_constraint: self.channel_description_constraint,
curator_application_human_readable_text: self.curator_application_human_readable_text,
curator_exit_rationale_text: self.curator_exit_rationale_text,

channel_title_constraint: self.channel_title_constraint,
channel_avatar_constraint: self.channel_avatar_constraint,
channel_banner_constraint: self.channel_banner_constraint,
Expand All @@ -101,25 +62,6 @@ impl<T: Trait> Default for GenesisConfigBuilder<T> {

Self {
mint_capacity: minting::BalanceOf::<T>::from(10000),

/*
current_lead_id: LeadId::<T>::default(), //Option<LeadId>,
lead_by_id: map![], //GenesisConfigMap<LeadId, Lead>,
next_lead_id: 0,
curator_opening_by_id: map![], //GenesisConfigMap<CuratorOpeningId, Opening>,
next_curator_opening_id: 0,
curator_application_by_id: map![], //GenesisConfigMap<CuratorApplicationId,CuratorApplication>,
next_curator_application_id: 0,
channel_by_id: map![], //GenesisConfigMap<ChannelId, Channel>,
next_channel_id: 0,
channel_id_by_handle: map![], //GenesisConfigMap<Vec<u8>, ChannelId>,
curator_by_id: map![], //GenesisConfigMap<CuratorId, Curator>,
next_curator_id: 0,
principal_by_id: map![], //GenesisConfigMap<PrinicipalId, Prinicipal>,
next_principal_id: 0,

unstaker_by_stake_id: map![], //GenesisConfigMap<LeadId, CuratorId>,
*/
channel_creation_enabled: true,
channel_handle_constraint: default_constraint.clone(),
channel_description_constraint: default_constraint.clone(),
Expand Down
Loading