Browse Source

Merge branch 'iznik' into colossus/minor-performance-enhancements

Mokhtar Naamani 4 years ago
parent
commit
41735e5ab9

+ 18 - 1
Cargo.lock

@@ -2053,7 +2053,7 @@ dependencies = [
 
 [[package]]
 name = "joystream-node-runtime"
-version = "7.2.0"
+version = "7.3.0"
 dependencies = [
  "frame-benchmarking",
  "frame-executive",
@@ -2095,6 +2095,7 @@ dependencies = [
  "pallet-token-mint",
  "pallet-transaction-payment",
  "pallet-transaction-payment-rpc-runtime-api",
+ "pallet-utility",
  "pallet-versioned-store",
  "pallet-versioned-store-permissions",
  "pallet-working-group",
@@ -3826,6 +3827,22 @@ dependencies = [
  "sp-std",
 ]
 
+[[package]]
+name = "pallet-utility"
+version = "2.0.0-rc4"
+source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
 [[package]]
 name = "pallet-versioned-store"
 version = "3.0.0"

+ 2 - 2
pioneer/packages/apps-routing/src/accounts.ts

@@ -12,9 +12,9 @@ export default function create (t: <T = string> (key: string, text: string, opti
     display: {
       needsApi: []
     },
-    icon: 'users',
+    icon: 'key',
     name: 'accounts',
-    text: t<string>('nav.accounts', 'Accounts', { ns: 'apps-routing' }),
+    text: t<string>('nav.accounts', 'My Keys', { ns: 'apps-routing' }),
     useCounter
   };
 }

+ 1 - 3
pioneer/packages/apps-routing/src/index.ts

@@ -18,7 +18,7 @@ import storage from './storage';
 import sudo from './sudo';
 import toolbox from './toolbox';
 import transfer from './transfer';
-import memo from './memo';
+// import memo from './memo';
 // Joy packages
 import members from './joy-members';
 import { terms, privacyPolicy } from './joy-pages';
@@ -41,7 +41,6 @@ export default function create (t: <T = string> (key: string, text: string, opti
       null,
       transfer(t),
       accounts(t),
-      memo(t),
       settings(t),
       // Those are hidden
       terms(t),
@@ -58,7 +57,6 @@ export default function create (t: <T = string> (key: string, text: string, opti
       null,
       transfer(t),
       accounts(t),
-      memo(t),
       settings(t),
       null,
       explorer(t),

+ 1 - 1
pioneer/packages/apps-routing/src/staking.ts

@@ -16,6 +16,6 @@ export default function create (t: <T = string> (key: string, text: string, opti
     },
     icon: 'certificate',
     name: 'staking',
-    text: t<string>('nav.staking', 'Staking', { ns: 'apps-routing' })
+    text: t<string>('nav.staking', 'Validators', { ns: 'apps-routing' })
   };
 }

+ 1 - 0
pioneer/packages/apps/public/locales/en/app-accounts.json

@@ -75,6 +75,7 @@
   "Multisig approvals": "Multisig approvals",
   "Multisig approvals pending": "Multisig approvals pending",
   "Multisig message with call (for final approval)": "Multisig message with call (for final approval)",
+  "My Memo": "My Memo",
   "My On-Chain Name": "My On-Chain Name",
   "My accounts": "My accounts",
   "My contacts": "My contacts",

+ 8 - 0
pioneer/packages/page-accounts/src/index.tsx

@@ -8,6 +8,7 @@ import React, { useMemo } from 'react';
 import { Route, Switch } from 'react-router';
 import { useAccounts, useIpfs } from '@polkadot/react-hooks';
 import { HelpOverlay, Tabs } from '@polkadot/react-components';
+import { MemoForm } from '@polkadot/joy-utils/react/components/Memo';
 
 import basicMd from './md/basic.md';
 import { useTranslation } from './translate';
@@ -35,6 +36,10 @@ function AccountsApp ({ basePath, onStatusChange }: Props): React.ReactElement<P
     {
       name: 'vanity',
       text: t<string>('Vanity generator')
+    },
+    {
+      name: 'memo',
+      text: t<string>('My Memo')
     }
   ], [t]);
   const hidden = useMemo(
@@ -65,6 +70,9 @@ function AccountsApp ({ basePath, onStatusChange }: Props): React.ReactElement<P
             onStatusChange={onStatusChange}
           />
         </Route>
+        <Route path={`${basePath}/memo`}>
+          <MemoForm />
+        </Route>
         <Route>
           <Accounts
             basePath={basePath}

+ 4 - 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.2.0'
+version = '7.3.0'
 
 [dependencies]
 # Third-party dependencies
@@ -51,6 +51,7 @@ pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git
 pallet-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
 pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
 pallet-collective = { package = 'pallet-collective', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+pallet-utility = { package = 'pallet-utility', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
 
 # Benchmarking
 frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true }
@@ -132,6 +133,7 @@ std = [
     'pallet-im-online/std',
     'pallet-collective/std',
     'pallet-offences/std',
+    'pallet-utility/std',
 
     # Joystream
     'common/std',
@@ -166,6 +168,7 @@ runtime-benchmarks = [
     "frame-system-benchmarking",
     "pallet-offences-benchmarking",
 	"pallet-session-benchmarking",
+    "pallet-utility/runtime-benchmarks",
 ]
 
 

+ 7 - 1
runtime/src/lib.rs

@@ -70,7 +70,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
     spec_name: create_runtime_str!("joystream-node"),
     impl_name: create_runtime_str!("joystream-node"),
     authoring_version: 7,
-    spec_version: 2,
+    spec_version: 3,
     impl_version: 0,
     apis: crate::runtime_api::EXPORTED_RUNTIME_API_VERSIONS,
     transaction_version: 1,
@@ -127,6 +127,11 @@ impl system::Trait for Runtime {
     type OnKilledAccount = ();
 }
 
+impl pallet_utility::Trait for Runtime {
+    type Event = Event;
+    type Call = Call;
+}
+
 parameter_types! {
     pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64;
     pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK;
@@ -578,6 +583,7 @@ construct_runtime!(
     {
         // Substrate
         System: system::{Module, Call, Storage, Config, Event<T>},
+        Utility: pallet_utility::{Module, Call, Event},
         Babe: pallet_babe::{Module, Call, Storage, Config, Inherent(Timestamp)},
         Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
         Authorship: pallet_authorship::{Module, Call, Storage, Inherent},