Skip to content

Commit

Permalink
Merge pull request #51 from Joystream/development
Browse files Browse the repository at this point in the history
dev - master - v5.3.0
  • Loading branch information
mnaamani authored Apr 27, 2019
2 parents b2d907a + 3024e33 commit ae76fc4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ['Joystream']
edition = '2018'
name = 'joystream-node-runtime'
version = '5.2.0'
version = '5.3.0'

[features]
default = ['std']
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("joystream-node"),
impl_name: create_runtime_str!("joystream-node"),
authoring_version: 5,
spec_version: 2,
spec_version: 3,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
};
Expand Down
20 changes: 17 additions & 3 deletions src/storage/data_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ decl_storage! {
pub StorageProviderAddress get(storage_provider_address): Vec<u8>;
// Default storage provider repository id
pub StorageProviderRepoId get(storage_provider_repo_id): Vec<u8>;
// Default storage provider account id, overrides all active storage providers as liason if set
pub PrimaryLiaisonAccountId get(primary_liaison_account_id): Option<T::AccountId>;
}
}

Expand Down Expand Up @@ -170,9 +172,13 @@ decl_module! {
ensure!(!<DataObjectByContentId<T>>::exists(content_id),
"Data object aready added under this content id");

// The liaison is something we need to take from staked roles. The idea
// is to select the liaison, for now randomly.
let liaison = T::Roles::random_account_for_role(actors::Role::Storage)?;
let liaison = match Self::primary_liaison_account_id() {
// Select primary liaison if set
Some(primary_liaison) => primary_liaison,

// Select liaison from staked roles if available
_ => T::Roles::random_account_for_role(actors::Role::Storage)?
};

// Let's create the entry then
let data: DataObject<T> = DataObject {
Expand Down Expand Up @@ -281,6 +287,14 @@ decl_module! {
<StorageProviderAddress<T>>::put(address);
}

fn set_primary_liaison_account_id(account: T::AccountId) {
<PrimaryLiaisonAccountId<T>>::put(account);
}

fn unset_primary_liaison_account_id() {
<PrimaryLiaisonAccountId<T>>::take();
}

fn remove_known_content_id(content_id: T::ContentId) {
let upd_content_ids: Vec<T::ContentId> = Self::known_content_ids()
.into_iter()
Expand Down
2 changes: 1 addition & 1 deletion wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ path = '..'
authors = ['Joystream']
edition = '2018'
name = 'joystream-node-runtime-wasm'
version = '5.2.0'
version = '5.3.0'

0 comments on commit ae76fc4

Please sign in to comment.