|
@@ -30,13 +30,6 @@ impl<T: Trait> Module<T> {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
- // Reset Council
|
|
|
- governance::election::Module::<T>::stop_election_and_dissolve_council()
|
|
|
- .err()
|
|
|
- .map(|err| {
|
|
|
- debug::warn!("Failed to dissolve council during migration: {:?}", err);
|
|
|
- });
|
|
|
-
|
|
|
// Reset working group mint capacity
|
|
|
content_working_group::Module::<T>::set_mint_capacity(
|
|
|
system::RawOrigin::Root.into(),
|
|
@@ -50,66 +43,6 @@ impl<T: Trait> Module<T> {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
- // Deactivate active curators
|
|
|
- let termination_reason = "resetting curators".as_bytes().to_vec();
|
|
|
-
|
|
|
- for (curator_id, ref curator) in content_working_group::CuratorById::<T>::enumerate() {
|
|
|
- // Skip non-active curators
|
|
|
- if curator.stage != content_working_group::CuratorRoleStage::Active {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- content_working_group::Module::<T>::terminate_curator_role_as_root(
|
|
|
- system::RawOrigin::Root.into(),
|
|
|
- curator_id,
|
|
|
- termination_reason.clone(),
|
|
|
- )
|
|
|
- .err()
|
|
|
- .map(|err| {
|
|
|
- debug::warn!(
|
|
|
- "Failed to terminate curator {:?} during migration: {:?}",
|
|
|
- curator_id,
|
|
|
- err
|
|
|
- );
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // Deactivate all storage providers, except Joystream providers (member id 0 in Rome runtime)
|
|
|
- let joystream_providers =
|
|
|
- roles::actors::AccountIdsByMemberId::<T>::get(T::MemberId::from(0));
|
|
|
-
|
|
|
- // Is there an intersect() like call to check if vector contains some elements from
|
|
|
- // another vector?.. below implementation just seems
|
|
|
- // silly to have to do in a filter predicate.
|
|
|
- let storage_providers_to_remove: Vec<T::AccountId> =
|
|
|
- roles::actors::Module::<T>::actor_account_ids()
|
|
|
- .into_iter()
|
|
|
- .filter(|account| {
|
|
|
- for provider in joystream_providers.as_slice() {
|
|
|
- if *account == *provider {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- return true;
|
|
|
- })
|
|
|
- .collect();
|
|
|
-
|
|
|
- for provider in storage_providers_to_remove {
|
|
|
- roles::actors::Module::<T>::remove_actor(system::RawOrigin::Root.into(), provider)
|
|
|
- .err()
|
|
|
- .map(|err| {
|
|
|
- debug::warn!(
|
|
|
- "Failed to remove storage provider during migration: {:?}",
|
|
|
- err
|
|
|
- );
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // Remove any pending storage entry requests, no stake is lost because only a fee is paid
|
|
|
- // to make a request.
|
|
|
- let no_requests: roles::actors::Requests<T> = vec![];
|
|
|
- roles::actors::RoleEntryRequests::<T>::put(no_requests);
|
|
|
-
|
|
|
// Set Storage Role reward to zero
|
|
|
if let Some(parameters) =
|
|
|
roles::actors::Parameters::<T>::get(roles::actors::Role::StorageProvider)
|
|
@@ -130,6 +63,7 @@ impl<T: Trait> Module<T> {
|
|
|
);
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
proposals_codex::Module::<T>::set_default_config_values();
|
|
|
|
|
|
Self::deposit_event(RawEvent::Migrated(
|
|
@@ -140,7 +74,11 @@ impl<T: Trait> Module<T> {
|
|
|
}
|
|
|
|
|
|
pub trait Trait:
|
|
|
- system::Trait + governance::election::Trait + content_working_group::Trait + roles::actors::Trait + proposals_codex::Trait
|
|
|
+ system::Trait
|
|
|
+ + governance::election::Trait
|
|
|
+ + content_working_group::Trait
|
|
|
+ + roles::actors::Trait
|
|
|
+ + proposals_codex::Trait
|
|
|
{
|
|
|
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
|
|
|
}
|