Browse Source

runtime: Delete memo pallet.

Shamil Gadelshin 3 years ago
parent
commit
b02d986c84
6 changed files with 0 additions and 91 deletions
  1. 0 13
      Cargo.lock
  2. 0 1
      Cargo.toml
  3. 0 24
      runtime-modules/memo/Cargo.toml
  4. 0 46
      runtime-modules/memo/src/lib.rs
  5. 0 2
      runtime/Cargo.toml
  6. 0 5
      runtime/src/lib.rs

+ 0 - 13
Cargo.lock

@@ -2365,7 +2365,6 @@ dependencies = [
  "pallet-grandpa",
  "pallet-im-online",
  "pallet-membership",
- "pallet-memo",
  "pallet-offences",
  "pallet-offences-benchmarking",
  "pallet-proposals-codex",
@@ -3958,18 +3957,6 @@ dependencies = [
  "sp-std",
 ]
 
-[[package]]
-name = "pallet-memo"
-version = "5.0.0"
-dependencies = [
- "frame-support",
- "frame-system",
- "pallet-balances",
- "parity-scale-codec",
- "sp-arithmetic",
- "sp-std",
-]
-
 [[package]]
 name = "pallet-offences"
 version = "2.0.1"

+ 0 - 1
Cargo.toml

@@ -8,7 +8,6 @@ members = [
 	"runtime-modules/council",
 	"runtime-modules/forum",
 	"runtime-modules/membership",
-	"runtime-modules/memo",
 	"runtime-modules/referendum",
 	"runtime-modules/storage",
 	"runtime-modules/working-group",

+ 0 - 24
runtime-modules/memo/Cargo.toml

@@ -1,24 +0,0 @@
-[package]
-name = 'pallet-memo'
-version = '5.0.0'
-authors = ['Joystream contributors']
-edition = '2018'
-
-[dependencies]
-codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
-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'}
-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'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
-
-[features]
-default = ['std']
-std = [
-	'codec/std',
-	'sp-arithmetic/std',
-	'sp-std/std',
-	'frame-support/std',
-	'frame-system/std',
-	'balances/std',
-]

+ 0 - 46
runtime-modules/memo/src/lib.rs

@@ -1,46 +0,0 @@
-// Ensure we're `no_std` when compiling for Wasm.
-#![cfg_attr(not(feature = "std"), no_std)]
-// Internal Substrate warning (decl_event).
-#![allow(clippy::unused_unit)]
-
-use frame_support::traits::Currency;
-use frame_support::{decl_event, decl_module, decl_storage, ensure};
-use frame_system::ensure_signed;
-use sp_arithmetic::traits::Zero;
-use sp_std::vec::Vec;
-
-pub trait Trait: frame_system::Trait + balances::Trait {
-    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
-}
-
-pub type MemoText = Vec<u8>;
-
-decl_storage! {
-    trait Store for Module<T: Trait> as Memo {
-        Memo get(fn memo) : map hasher(blake2_128_concat) T::AccountId => MemoText;
-        MaxMemoLength get(fn max_memo_length) : u32 = 4096;
-    }
-}
-
-decl_event! {
-    pub enum Event<T> where <T as frame_system::Trait>::AccountId {
-        MemoUpdated(AccountId, MemoText),
-    }
-}
-
-decl_module! {
-    pub struct Module<T: Trait> for enum Call where origin: T::Origin {
-        fn deposit_event() = default;
-
-        #[weight = 10_000_000] // TODO: adjust weight
-        fn update_memo(origin, memo: MemoText) {
-            let sender = ensure_signed(origin)?;
-
-            ensure!(!<balances::Module<T>>::total_balance(&sender).is_zero(), "account must have a balance");
-            ensure!(memo.len() as u32 <= Self::max_memo_length(), "memo too long");
-
-            <Memo<T>>::insert(&sender, memo.clone());
-            Self::deposit_event(RawEvent::MemoUpdated(sender, memo));
-        }
-    }
-}

+ 0 - 2
runtime/Cargo.toml

@@ -64,7 +64,6 @@ hex-literal = { optional = true, version = '0.3.1' }
 
 # Joystream
 common = { package = 'pallet-common', default-features = false, path = '../runtime-modules/common'}
-memo = { package = 'pallet-memo', default-features = false, path = '../runtime-modules/memo'}
 forum = { package = 'pallet-forum', default-features = false, path = '../runtime-modules/forum'}
 membership = { package = 'pallet-membership', default-features = false, path = '../runtime-modules/membership'}
 referendum = { package = 'pallet-referendum', default-features = false, path = '../runtime-modules/referendum'}
@@ -139,7 +138,6 @@ std = [
 
     # Joystream
     'common/std',
-    'memo/std',
     'forum/std',
     'membership/std',
     'council/std',

+ 0 - 5
runtime/src/lib.rs

@@ -575,10 +575,6 @@ impl common::StorageOwnership for Runtime {
     type DataObjectTypeId = DataObjectTypeId;
 }
 
-impl memo::Trait for Runtime {
-    type Event = Event;
-}
-
 parameter_types! {
     pub const MaxDistributionBucketFamilyNumber: u64 = 200;
     pub const DataObjectDeletionPrize: Balance = 0; //TODO: Change during Olympia release
@@ -1133,7 +1129,6 @@ construct_runtime!(
         // Joystream
         Council: council::{Module, Call, Storage, Event<T>, Config<T>},
         Referendum: referendum::<Instance1>::{Module, Call, Storage, Event<T>, Config<T>},
-        Memo: memo::{Module, Call, Storage, Event<T>},
         Members: membership::{Module, Call, Storage, Event<T>, Config<T>},
         Forum: forum::{Module, Call, Storage, Event<T>, Config<T>},
         Constitution: pallet_constitution::{Module, Call, Storage, Event},