Browse Source

runtime: update rust version

conectado 3 years ago
parent
commit
76d7c90a07

File diff suppressed because it is too large
+ 126 - 154
Cargo.lock


+ 2 - 2
runtime-modules/common/Cargo.toml

@@ -13,8 +13,8 @@ sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://
 frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca'}
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
 
 [features]
 default = ['std']

+ 2 - 1
runtime-modules/common/src/storage.rs

@@ -19,7 +19,8 @@ pub struct ContentParameters<ContentId, DataObjectTypeId> {
 pub enum StorageObjectOwner<MemberId, ChannelId, DAOId> {
     Member(MemberId),
     Channel(ChannelId), // acts through content directory module, where again DAOs can own channels for example
-    DAO(DAOId),         // acts through upcoming `content_finance` module
+    #[allow(clippy::upper_case_acronyms)]
+    DAO(DAOId), // acts through upcoming `content_finance` module
     Council,            // acts through proposal frame_system
     WorkingGroup(WorkingGroup), // acts through new extrinsic in working group
 }

+ 48 - 48
runtime-modules/content/src/lib.rs

@@ -867,9 +867,9 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn request_channel_transfer(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            request: ChannelOwnershipTransferRequest<T>,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _request: ChannelOwnershipTransferRequest<T>,
         ) {
             // requester must be new_owner
             Self::not_implemented()?;
@@ -877,8 +877,8 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn cancel_channel_transfer_request(
-            origin,
-            request_id: T::ChannelOwnershipTransferRequestId,
+            _origin,
+            _request_id: T::ChannelOwnershipTransferRequestId,
         ) {
             // origin must be original requester (ie. proposed new channel owner)
             Self::not_implemented()?;
@@ -886,9 +886,9 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn accept_channel_transfer(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            request_id: T::ChannelOwnershipTransferRequestId,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _request_id: T::ChannelOwnershipTransferRequestId,
         ) {
             // only current owner of channel can approve
             Self::not_implemented()?;
@@ -1042,30 +1042,30 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn create_playlist(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            channel_id: T::ChannelId,
-            params: PlaylistCreationParameters,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _channel_id: T::ChannelId,
+            _params: PlaylistCreationParameters,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn update_playlist(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            playlist: T::PlaylistId,
-            params: PlaylistUpdateParameters,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _playlist: T::PlaylistId,
+            _params: PlaylistUpdateParameters,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn delete_playlist(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            channel_id: T::ChannelId,
-            playlist: T::PlaylistId,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _channel_id: T::ChannelId,
+            _playlist: T::PlaylistId,
         ) {
             Self::not_implemented()?;
         }
@@ -1150,47 +1150,47 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn create_person(
-            origin,
-            actor: PersonActor<T::MemberId, T::CuratorId>,
-            params: PersonCreationParameters<ContentParameters<T>>,
+            _origin,
+            _actor: PersonActor<T::MemberId, T::CuratorId>,
+            _params: PersonCreationParameters<ContentParameters<T>>,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn update_person(
-            origin,
-            actor: PersonActor<T::MemberId, T::CuratorId>,
-            person: T::PersonId,
-            params: PersonUpdateParameters<ContentParameters<T>>,
+            _origin,
+            _actor: PersonActor<T::MemberId, T::CuratorId>,
+            _person: T::PersonId,
+            _params: PersonUpdateParameters<ContentParameters<T>>,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn delete_person(
-            origin,
-            actor: PersonActor<T::MemberId, T::CuratorId>,
-            person: T::PersonId,
+            _origin,
+            _actor: PersonActor<T::MemberId, T::CuratorId>,
+            _person: T::PersonId,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn add_person_to_video(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            video_id: T::VideoId,
-            person: T::PersonId
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _video_id: T::VideoId,
+            _person: T::PersonId
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn remove_person_from_video(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            video_id: T::VideoId
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _video_id: T::VideoId
         ) {
             Self::not_implemented()?;
         }
@@ -1233,29 +1233,29 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn create_series(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            channel_id: T::ChannelId,
-            params: SeriesParameters<T::VideoId, ContentParameters<T>>,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _channel_id: T::ChannelId,
+            _params: SeriesParameters<T::VideoId, ContentParameters<T>>,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn update_series(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            channel_id: T::ChannelId,
-            params: SeriesParameters<T::VideoId, ContentParameters<T>>,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _channel_id: T::ChannelId,
+            _params: SeriesParameters<T::VideoId, ContentParameters<T>>,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn delete_series(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            series: T::SeriesId,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _series: T::SeriesId,
         ) {
             Self::not_implemented()?;
         }

+ 2 - 2
runtime-modules/governance/src/council.rs

@@ -32,7 +32,7 @@ decl_storage! {
     trait Store for Module<T: Trait> as Council {
         pub ActiveCouncil get(fn active_council) config(): Seats<T::AccountId, BalanceOf<T>>;
 
-        pub TermEndsAt get(fn term_ends_at) config() : T::BlockNumber = T::BlockNumber::from(1);
+        pub TermEndsAt get(fn term_ends_at) config() : T::BlockNumber = T::BlockNumber::from(1u32);
 
         /// The mint that funds council member rewards and spending proposals budget
         pub CouncilMint get(fn council_mint) : <T as minting::Trait>::MintId;
@@ -56,7 +56,7 @@ decl_storage! {
         build(|_config: &GenesisConfig<T>| {
             // Create the council mint.
             let mint_id_result = <minting::Module<T>>::add_mint(
-                minting::BalanceOf::<T>::from(0),
+                minting::BalanceOf::<T>::from(0u32),
                 None
             );
 

+ 7 - 13
runtime-modules/hiring/src/lib.rs

@@ -13,6 +13,7 @@
 //!
 //! Dependency: Joystream stake module
 
+#![allow(clippy::collapsible_match)]
 // Ensure we're `no_std` when compiling for Wasm.
 #![cfg_attr(not(feature = "std"), no_std)]
 // Do not delete! Cannot be uncommented by default, because of Parity decl_module! issue.
@@ -1256,14 +1257,9 @@ impl<T: Trait> Module<T> {
         opt_imbalance: Option<NegativeImbalance<T>>,
         application_id: &T::ApplicationId,
     ) -> Option<T::StakeId> {
-        if let Some(imbalance) = opt_imbalance {
-            Some(Self::infallible_stake_initiation_on_application(
-                imbalance,
-                application_id,
-            ))
-        } else {
-            None
-        }
+        opt_imbalance.map(|imbalance| {
+            Self::infallible_stake_initiation_on_application(imbalance, application_id)
+        })
     }
 
     fn infallible_stake_initiation_on_application(
@@ -1398,11 +1394,9 @@ impl<T: Trait> Module<T> {
     pub(crate) fn create_stake_balance(
         opt_stake_imbalance: &Option<NegativeImbalance<T>>,
     ) -> Option<BalanceOf<T>> {
-        if let Some(ref imbalance) = opt_stake_imbalance {
-            Some(imbalance.peek())
-        } else {
-            None
-        }
+        opt_stake_imbalance
+            .as_ref()
+            .map(|imbalance| imbalance.peek())
     }
 
     /// Performs all necessary check before adding an opening

+ 1 - 1
runtime-modules/membership/src/genesis.rs

@@ -59,7 +59,7 @@ impl<T: Trait> GenesisConfigBuilder<T> {
                 handle: (10000 + ix).to_string(),
                 avatar_uri: "".into(),
                 about: "".into(),
-                registered_at_time: T::Moment::from(0),
+                registered_at_time: T::Moment::from(0u32),
             })
             .collect()
     }

+ 1 - 1
runtime-modules/membership/src/lib.rs

@@ -230,7 +230,7 @@ decl_storage! {
                     &member.controller_account,
                     &checked_user_info,
                     EntryMethod::Genesis,
-                    T::BlockNumber::from(1),
+                    T::BlockNumber::from(1u32),
                     member.registered_at_time
                 ).expect("Importing Member Failed");
 

+ 1 - 1
runtime-modules/proposals/codex/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = 'pallet-proposals-codex'
-version = '3.1.1'
+version = '3.2.0'
 authors = ['Joystream contributors']
 edition = '2018'
 

+ 2 - 0
runtime-modules/proposals/codex/src/tests/mock.rs

@@ -1,4 +1,6 @@
 #![cfg(test)]
+// Internal substrate warning.
+#![allow(non_fmt_panic)]
 
 use frame_support::{impl_outer_dispatch, impl_outer_origin, parameter_types};
 pub use frame_system;

+ 1 - 1
runtime-modules/recurring-reward/src/lib.rs

@@ -4,7 +4,7 @@
 
 // Clippy linter warning. TODO: refactor the Option<Option<>>
 #![allow(clippy::option_option)] // disable it because of possible API break
-
+#![allow(clippy::result_unit_err)]
 // Ensure we're `no_std` when compiling for Wasm.
 #![cfg_attr(not(feature = "std"), no_std)]
 

+ 0 - 18
runtime-modules/storage/src/tests/mock.rs

@@ -79,9 +79,7 @@ impl SetLeadFixture {
 }
 
 pub const TEST_FIRST_DATA_OBJECT_TYPE_ID: u64 = 1000;
-pub const TEST_FIRST_CONTENT_ID: u64 = 2000;
 pub const TEST_FIRST_RELATIONSHIP_ID: u64 = 3000;
-pub const TEST_FIRST_METADATA_ID: u64 = 4000;
 
 pub const TEST_MOCK_LIAISON_STORAGE_PROVIDER_ID: u32 = 1;
 pub const TEST_MOCK_EXISTING_CID: u64 = 42;
@@ -275,9 +273,7 @@ pub struct ExtBuilder {
     global_voucher: Voucher,
     default_voucher: Voucher,
     first_data_object_type_id: u64,
-    first_content_id: u64,
     first_relationship_id: u64,
-    first_metadata_id: u64,
     uploading_blocked: bool,
 }
 
@@ -289,9 +285,7 @@ impl Default for ExtBuilder {
             global_voucher: DEFAULT_GLOBAL_VOUCHER,
             default_voucher: DEFAULT_VOUCHER,
             first_data_object_type_id: 1,
-            first_content_id: 2,
             first_relationship_id: 3,
-            first_metadata_id: 4,
             uploading_blocked: DEFAULT_UPLOADING_BLOCKED_STATUS,
         }
     }
@@ -303,21 +297,11 @@ impl ExtBuilder {
         self
     }
 
-    pub fn first_content_id(mut self, first_content_id: u64) -> Self {
-        self.first_content_id = first_content_id;
-        self
-    }
-
     pub fn first_relationship_id(mut self, first_relationship_id: u64) -> Self {
         self.first_relationship_id = first_relationship_id;
         self
     }
 
-    pub fn first_metadata_id(mut self, first_metadata_id: u64) -> Self {
-        self.first_metadata_id = first_metadata_id;
-        self
-    }
-
     pub fn uploading_blocked_status(mut self, uploading_blocked: bool) -> Self {
         self.uploading_blocked = uploading_blocked;
         self
@@ -387,9 +371,7 @@ pub type TestDataObjectStorageRegistry = data_object_storage_registry::Module<Te
 pub fn with_default_mock_builder<R, F: FnOnce() -> R>(f: F) -> R {
     ExtBuilder::default()
         .first_data_object_type_id(TEST_FIRST_DATA_OBJECT_TYPE_ID)
-        .first_content_id(TEST_FIRST_CONTENT_ID)
         .first_relationship_id(TEST_FIRST_RELATIONSHIP_ID)
-        .first_metadata_id(TEST_FIRST_METADATA_ID)
         .build()
         .execute_with(|| f())
 }

+ 1 - 1
runtime-modules/token-minting/src/lib.rs

@@ -2,7 +2,7 @@
 #![allow(clippy::type_complexity)]
 // disable it because of possible frontend API break
 // TODO: remove post-Constaninople
-
+#![allow(clippy::collapsible_match)]
 // Ensure we're `no_std` when compiling for Wasm.
 #![cfg_attr(not(feature = "std"), no_std)]
 

+ 4 - 6
runtime-modules/working-group/src/lib.rs

@@ -1631,17 +1631,15 @@ impl<T: Trait<I>, I: Instance> Module<T, I> {
                     hiring::ApplicationById::<T>::get(successful_application.hiring_application_id);
 
                 // Staking profile for worker
-                let stake_profile = if let Some(ref stake_id) = application.active_role_staking_id {
-                    Some(RoleStakeProfile::new(
+                let stake_profile = application.active_role_staking_id.as_ref().map(|stake_id| {
+                    RoleStakeProfile::new(
                         stake_id,
                         &opening
                             .policy_commitment
                             .terminate_role_stake_unstaking_period,
                         &opening.policy_commitment.exit_role_stake_unstaking_period,
-                    ))
-                } else {
-                    None
-                };
+                    )
+                });
 
                 // Get worker id
                 let new_worker_id = <NextWorkerId<T, I>>::get();

+ 1 - 1
runtime/Cargo.toml

@@ -4,7 +4,7 @@ edition = '2018'
 name = 'joystream-node-runtime'
 # Follow convention: https://github.com/Joystream/substrate-runtime-joystream/issues/1
 # {Authoring}.{Spec}.{Impl} of the RuntimeVersion
-version = '7.16.0'
+version = '9.0.0'
 
 [dependencies]
 # Third-party dependencies

+ 4 - 2
runtime/src/lib.rs

@@ -6,6 +6,8 @@
 //Substrate internal issues.
 #![allow(clippy::large_enum_variant)]
 #![allow(clippy::unnecessary_mut_passed)]
+#![allow(non_fmt_panic)]
+#![allow(clippy::from_over_into)]
 
 // Make the WASM binary available.
 // This is required only by the node build.
@@ -82,8 +84,8 @@ pub use content::MaxNumber;
 pub const VERSION: RuntimeVersion = RuntimeVersion {
     spec_name: create_runtime_str!("joystream-node"),
     impl_name: create_runtime_str!("joystream-node"),
-    authoring_version: 7,
-    spec_version: 16,
+    authoring_version: 9,
+    spec_version: 0,
     impl_version: 0,
     apis: crate::runtime_api::EXPORTED_RUNTIME_API_VERSIONS,
     transaction_version: 1,

+ 1 - 1
runtime/src/tests/proposals_integration/working_group_proposals.rs

@@ -959,7 +959,7 @@ fn create_fill_working_group_leader_opening_proposal_execution_succeeds() {
             initial_test_ext().execute_with(|| {
                 let member_id: MemberId = 1;
                 let account_id: [u8; 32] = [member_id as u8; 32];
-                let stake_amount = 100;
+                let stake_amount = 100u32;
 
                 let opening_policy_commitment = OpeningPolicyCommitment {
                     role_staking_policy: Some(hiring::StakingPolicy {

+ 8 - 11
setup.sh

@@ -5,7 +5,7 @@ set -e
 if [[ "$OSTYPE" == "linux-gnu" ]]; then
     # code build tools
     sudo apt-get update
-    sudo apt-get install -y coreutils clang jq curl gcc xz-utils sudo pkg-config unzip clang libc6-dev-i386 make libssl-dev python
+    sudo apt-get install -y coreutils clang llvm jq curl gcc xz-utils sudo pkg-config unzip libc6-dev make libssl-dev python
     # docker
     sudo apt-get install -y docker.io docker-compose containerd runc
 elif [[ "$OSTYPE" == "darwin"* ]]; then
@@ -15,7 +15,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
     fi
     # install additional packages
     brew update
-    brew install b2sum gnu-tar jq curl
+    brew install coreutils gnu-tar jq curl
     echo "It is recommended to setup Docker desktop from: https://www.docker.com/products/docker-desktop"
 fi
 
@@ -25,24 +25,21 @@ curl https://getsubstrate.io -sSf | bash -s -- --fast
 
 source ~/.cargo/env
 
-rustup component add rustfmt clippy
+rustup install nightly-2021-03-24
+rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-24
 
-rustup install nightly-2020-10-06
-rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-06
+rustup default nightly-2021-03-24
 
-rustup install 1.47.0
-rustup default 1.47.0
+rustup component add rustfmt clippy
 
 # Volta nodejs, npm, yarn tools manager
 curl https://get.volta.sh | bash
 
 # source env variables added by Volta
-source source ~/.bash_profile || ~/.profile || source ~/.bashrc || :
+source ~/.bash_profile || source ~/.profile || source ~/.bashrc || :
 
 volta install node@12
 volta install yarn
 volta install npx
 
-echo "Starting new terminal/shell session to make newly installed tools available."
-
-exec bash -l
+echo "You may need to open a new terminal/shell session to make newly installed tools available."

Some files were not shown because too many files changed in this diff