git.delta.rocks / unique-network / refs/commits / d89590b11016

difftreelog

Updated to rc3

str-mv2020-07-14parent: #188c586.patch.diff
in: master

12 files changed

modifiedCargo.lockdiffbeforeafterboth
before · Cargo.lock
559 packageslockfile v1
after · Cargo.lock
589 packageslockfile v1
modifiednode/Cargo.tomldiffbeforeafterboth
--- a/node/Cargo.toml
+++ b/node/Cargo.toml
@@ -1,13 +1,21 @@
+[build-dependencies.substrate-build-script-utils]
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
+
+[[bin]]
+name = 'nft'
+
 [package]
-authors = ['Anonymous']
+authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
 build = 'build.rs'
-description = 'Substrate Node nft'
+description = 'Substrate node nft'
 edition = '2018'
-homepage = 'https://substrate.dev'
+homepage = 'https://substrate.io'
 license = 'Unlicense'
 name = 'nft'
-repository = 'https://github.com/paritytech/substrate/'
-version = '2.0.0-alpha.6'
+repository = 'https://github.com/substrate-developer-hub/nft/'
+version = '2.0.0-rc3'
 
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
@@ -15,71 +23,104 @@
 [dependencies]
 futures = '0.3.4'
 log = '0.4.8'
+parking_lot = '0.10.0'
 structopt = '0.3.8'
 jsonrpc-core = '14.0.5'
-
-[dependencies.pallet-contracts-rpc]
-version = '0.8.0-alpha.6'
 
-[dependencies.sc-rpc]
-version = '2.0.0-alpha.6'
-
 [dependencies.nft-runtime]
 path = '../runtime'
-version = '2.0.0-alpha.6'
+version = '2.0.0-rc3'
 
 [dependencies.sc-basic-authorship]
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
 [dependencies.sc-cli]
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
+
+[dependencies.sc-client-api]
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
+
+[dependencies.sc-consensus]
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
-[dependencies.sc-client]
-version = '0.8.0-alpha.6'
+[dependencies.pallet-contracts-rpc]
+git = 'https://github.com/paritytech/substrate.git'
+version = '0.8.0-rc3'
+tag = 'v2.0.0-rc3'
 
-[dependencies.sc-client-api]
-version = '2.0.0-alpha.6'
+[dependencies.sc-rpc]
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
 
 [dependencies.sc-consensus-aura]
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
 [dependencies.sc-executor]
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
 [dependencies.sc-finality-grandpa]
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
 [dependencies.sc-network]
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
 [dependencies.sc-service]
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
 [dependencies.sc-transaction-pool]
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-consensus]
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
 [dependencies.sp-consensus-aura]
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
 [dependencies.sp-core]
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-finality-grandpa]
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-inherents]
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-runtime]
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-transaction-pool]
-version = '2.0.0-alpha.6'
-[build-dependencies.substrate-build-script-utils]
-version = '2.0.0-alpha.6'
-
-[[bin]]
-name = 'nft'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
modifiednode/build.rsdiffbeforeafterboth
--- a/node/build.rs
+++ b/node/build.rs
@@ -1,7 +1,7 @@
 use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
 
 fn main() {
-	generate_cargo_keys();
+    generate_cargo_keys();
 
-	rerun_if_git_head_changed();
+    rerun_if_git_head_changed();
 }
modifiednode/src/chain_spec.rsdiffbeforeafterboth
--- a/node/src/chain_spec.rs
+++ b/node/src/chain_spec.rs
@@ -1,13 +1,13 @@
-use sp_core::{Pair, Public, sr25519};
 use nft_runtime::{
-	AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig,
-	SudoConfig, SystemConfig, WASM_BINARY, Signature
+    AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig,
+    SystemConfig, WASM_BINARY,
 };
+use nft_runtime::{ContractsConfig, ContractsSchedule};
+use sc_service::ChainType;
 use sp_consensus_aura::sr25519::AuthorityId as AuraId;
+use sp_core::{sr25519, Pair, Public};
 use sp_finality_grandpa::AuthorityId as GrandpaId;
-use sp_runtime::traits::{Verify, IdentifyAccount};
-use sc_service::ChainType;
-use nft_runtime::{ContractsConfig, ContractsSchedule};
+use sp_runtime::traits::{IdentifyAccount, Verify};
 
 // Note this is the URL for the telemetry server
 //const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
@@ -17,117 +17,122 @@
 
 /// Helper function to generate a crypto pair from seed
 pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
-	TPublic::Pair::from_string(&format!("//{}", seed), None)
-		.expect("static values are valid; qed")
-		.public()
+    TPublic::Pair::from_string(&format!("//{}", seed), None)
+        .expect("static values are valid; qed")
+        .public()
 }
 
 type AccountPublic = <Signature as Verify>::Signer;
 
 /// Helper function to generate an account ID from seed
-pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId where
-	AccountPublic: From<<TPublic::Pair as Pair>::Public>
+pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId
+where
+    AccountPublic: From<<TPublic::Pair as Pair>::Public>,
 {
-	AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()
+    AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()
 }
 
 /// Helper function to generate an authority key for Aura
 pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {
-	(
-		get_from_seed::<AuraId>(s),
-		get_from_seed::<GrandpaId>(s),
-	)
+    (get_from_seed::<AuraId>(s), get_from_seed::<GrandpaId>(s))
 }
 
 pub fn development_config() -> ChainSpec {
-	ChainSpec::from_genesis(
-		"Development",
-		"dev",
-		ChainType::Development,
-		|| testnet_genesis(
-			vec![
-				authority_keys_from_seed("Alice"),
-			],
-			get_account_id_from_seed::<sr25519::Public>("Alice"),
-			vec![
-				get_account_id_from_seed::<sr25519::Public>("Alice"),
-				get_account_id_from_seed::<sr25519::Public>("Bob"),
-				get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
-			],
-			true,
-		),
-		vec![],
-		None,
-		None,
-		None,
-		None,
-	)
+    ChainSpec::from_genesis(
+        "Development",
+        "dev",
+        ChainType::Development,
+        || {
+            testnet_genesis(
+                vec![authority_keys_from_seed("Alice")],
+                get_account_id_from_seed::<sr25519::Public>("Alice"),
+                vec![
+                    get_account_id_from_seed::<sr25519::Public>("Alice"),
+                    get_account_id_from_seed::<sr25519::Public>("Bob"),
+                    get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
+                    get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
+                ],
+                true,
+            )
+        },
+        vec![],
+        None,
+        None,
+        None,
+        None,
+    )
 }
 
 pub fn local_testnet_config() -> ChainSpec {
-	ChainSpec::from_genesis(
-		"Local Testnet",
-		"local_testnet",
-		ChainType::Local,
-		|| testnet_genesis(
-			vec![
-				authority_keys_from_seed("Alice"),
-				authority_keys_from_seed("Bob"),
-			],
-			get_account_id_from_seed::<sr25519::Public>("Alice"),
-			vec![
-				get_account_id_from_seed::<sr25519::Public>("Alice"),
-				get_account_id_from_seed::<sr25519::Public>("Bob"),
-				get_account_id_from_seed::<sr25519::Public>("Charlie"),
-				get_account_id_from_seed::<sr25519::Public>("Dave"),
-				get_account_id_from_seed::<sr25519::Public>("Eve"),
-				get_account_id_from_seed::<sr25519::Public>("Ferdie"),
-				get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
-			],
-			true,
-		),
-		vec![],
-		None,
-		None,
-		None,
-		None,
-	)
+    ChainSpec::from_genesis(
+        "Local Testnet",
+        "local_testnet",
+        ChainType::Local,
+        || {
+            testnet_genesis(
+                vec![
+                    authority_keys_from_seed("Alice"),
+                    authority_keys_from_seed("Bob"),
+                ],
+                get_account_id_from_seed::<sr25519::Public>("Alice"),
+                vec![
+                    get_account_id_from_seed::<sr25519::Public>("Alice"),
+                    get_account_id_from_seed::<sr25519::Public>("Bob"),
+                    get_account_id_from_seed::<sr25519::Public>("Charlie"),
+                    get_account_id_from_seed::<sr25519::Public>("Dave"),
+                    get_account_id_from_seed::<sr25519::Public>("Eve"),
+                    get_account_id_from_seed::<sr25519::Public>("Ferdie"),
+                    get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
+                    get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
+                    get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
+                    get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
+                    get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
+                    get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
+                ],
+                true,
+            )
+        },
+        vec![],
+        None,
+        None,
+        None,
+        None,
+    )
 }
 
-fn testnet_genesis(initial_authorities: Vec<(AuraId, GrandpaId)>,
-	root_key: AccountId,
-	endowed_accounts: Vec<AccountId>,
-	_enable_println: bool
-	) -> GenesisConfig {
-	GenesisConfig {
-		system: Some(SystemConfig {
-			code: WASM_BINARY.to_vec(),
-			changes_trie_config: Default::default(),
-		}),
-		balances: Some(BalancesConfig {
-			balances: endowed_accounts.iter().cloned().map(|k|(k, 1 << 60)).collect(),
-		}),
-		aura: Some(AuraConfig {
-			authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),
-		}),
-		grandpa: Some(GrandpaConfig {
-			authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(),
-		}),
-		sudo: Some(SudoConfig {
-			key: root_key,
-		}),
-		contracts: Some(ContractsConfig {
-			gas_price: 1_000,
+fn testnet_genesis(
+    initial_authorities: Vec<(AuraId, GrandpaId)>,
+    root_key: AccountId,
+    endowed_accounts: Vec<AccountId>,
+    _enable_println: bool,
+) -> GenesisConfig {
+    GenesisConfig {
+        system: Some(SystemConfig {
+            code: WASM_BINARY.to_vec(),
+            changes_trie_config: Default::default(),
+        }),
+        balances: Some(BalancesConfig {
+            balances: endowed_accounts
+                .iter()
+                .cloned()
+                .map(|k| (k, 1 << 60))
+                .collect(),
+        }),
+        aura: Some(AuraConfig {
+            authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),
+        }),
+        grandpa: Some(GrandpaConfig {
+            authorities: initial_authorities
+                .iter()
+                .map(|x| (x.1.clone(), 1))
+                .collect(),
+        }),
+        sudo: Some(SudoConfig { key: root_key }),
+        contracts: Some(ContractsConfig {
             current_schedule: ContractsSchedule {
-            		// enable_println,
-                    ..Default::default()
+                // enable_println,
+                ..Default::default()
             },
         }),
-	}
+    }
 }
modifiednode/src/command.rsdiffbeforeafterboth
--- a/node/src/command.rs
+++ b/node/src/command.rs
@@ -1,24 +1,24 @@
-// Copyright 2017-2020 Parity Technologies (UK) Ltd.
 // This file is part of Substrate.
 
-// Substrate is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: Apache-2.0
 
-// Substrate is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Substrate.  If not, see <http://www.gnu.org/licenses/>.
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// 	http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 use crate::chain_spec;
 use crate::cli::Cli;
 use crate::service;
 use sc_cli::SubstrateCli;
-use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
 
 impl SubstrateCli for Cli {
 	fn impl_name() -> &'static str {
@@ -78,4 +78,4 @@
 			)
 		}
 	}
-}
+}
\ No newline at end of file
modifiednode/src/service.rsdiffbeforeafterboth
--- a/node/src/service.rs
+++ b/node/src/service.rs
@@ -1,22 +1,25 @@
 //! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
 
-use std::sync::Arc;
-use std::time::Duration;
-use sc_client::LongestChain;
-use sc_client_api::ExecutorProvider;
 use nft_runtime::{self, opaque::Block, RuntimeApi};
-use sc_service::{error::{Error as ServiceError}, AbstractService, Configuration, ServiceBuilder};
-use sp_inherents::InherentDataProviders;
+use sc_client_api::ExecutorProvider;
+use sc_consensus::LongestChain;
 use sc_executor::native_executor_instance;
 pub use sc_executor::NativeExecutor;
-use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};
-use sc_finality_grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider};
+use sc_finality_grandpa::{
+    FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState,
+    StorageAndProofProvider,
+};
+use sc_service::{error::Error as ServiceError, AbstractService, Configuration, ServiceBuilder};
+use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
+use sp_inherents::InherentDataProviders;
+use std::sync::Arc;
+use std::time::Duration;
 
 // Our native executor instance.
 native_executor_instance!(
-	pub Executor,
-	nft_runtime::api::dispatch,
-	nft_runtime::native_version,
+    pub Executor,
+    nft_runtime::api::dispatch,
+    nft_runtime::native_version,
 );
 
 /// Starts a `ServiceBuilder` for a full service.
@@ -24,213 +27,246 @@
 /// Use this macro if you don't actually need the full service, but just the builder in order to
 /// be able to perform chain operations.
 macro_rules! new_full_start {
-	($config:expr) => {{
-		use jsonrpc_core::IoHandler;
-		use std::sync::Arc;
-		let mut import_setup = None;
-		let inherent_data_providers = sp_inherents::InherentDataProviders::new();
+    ($config:expr) => {{
+        use jsonrpc_core::IoHandler;
+        use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
+        use std::sync::Arc;
 
-		let builder = sc_service::ServiceBuilder::new_full::<
-			nft_runtime::opaque::Block, nft_runtime::RuntimeApi, crate::service::Executor
-		>($config)?
-			.with_select_chain(|_config, backend| {
-				Ok(sc_client::LongestChain::new(backend.clone()))
-			})?
-			.with_transaction_pool(|config, client, _fetcher| {
-				let pool_api = sc_transaction_pool::FullChainApi::new(client.clone());
-				Ok(sc_transaction_pool::BasicPool::new(config, std::sync::Arc::new(pool_api)))
-			})?
-			.with_import_queue(|_config, client, mut select_chain, _transaction_pool| {
-				let select_chain = select_chain.take()
-					.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
+        let mut import_setup = None;
+        let inherent_data_providers = sp_inherents::InherentDataProviders::new();
 
-				let (grandpa_block_import, grandpa_link) =
-					sc_finality_grandpa::block_import(client.clone(), &(client.clone() as Arc<_>), select_chain)?;
+        let builder = sc_service::ServiceBuilder::new_full::<
+            nft_runtime::opaque::Block,
+            nft_runtime::RuntimeApi,
+            crate::service::Executor,
+        >($config)?
+        .with_select_chain(|_config, backend| Ok(sc_consensus::LongestChain::new(backend.clone())))?
+        .with_transaction_pool(|builder| {
+            let pool_api = sc_transaction_pool::FullChainApi::new(builder.client().clone());
+            Ok(sc_transaction_pool::BasicPool::new(
+                builder.config().transaction_pool.clone(),
+                std::sync::Arc::new(pool_api),
+                builder.prometheus_registry(),
+            ))
+        })?
+        .with_import_queue(
+            |_config, client, mut select_chain, _transaction_pool, spawn_task_handle, registry| {
+                let select_chain = select_chain
+                    .take()
+                    .ok_or_else(|| sc_service::Error::SelectChainRequired)?;
 
-				let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(
-					grandpa_block_import.clone(), client.clone(),
-				);
+                let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
+                    client.clone(),
+                    &(client.clone() as Arc<_>),
+                    select_chain,
+                )?;
 
-				let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair>(
-					sc_consensus_aura::slot_duration(&*client)?,
-					aura_block_import,
-					Some(Box::new(grandpa_block_import.clone())),
-					None,
-					client,
-					inherent_data_providers.clone(),
-				)?;
+                let aura_block_import =
+                    sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(
+                        grandpa_block_import.clone(),
+                        client.clone(),
+                    );
 
-				import_setup = Some((grandpa_block_import, grandpa_link));
+                let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>(
+                    sc_consensus_aura::slot_duration(&*client)?,
+                    aura_block_import,
+                    Some(Box::new(grandpa_block_import.clone())),
+                    None,
+                    client,
+                    inherent_data_providers.clone(),
+                    spawn_task_handle,
+                    registry,
+                )?;
 
-				Ok(import_queue)
-			})?
-			.with_rpc_extensions(|builder| -> Result<IoHandler<sc_rpc::Metadata>, _> {
-                let handler = pallet_contracts_rpc::Contracts::new(builder.client().clone());
-                let delegate = pallet_contracts_rpc::ContractsApi::to_delegate(handler);
+                import_setup = Some((grandpa_block_import, grandpa_link));
 
-                let mut io = IoHandler::default();
-                io.extend_with(delegate);
-                Ok(io)
-            })?;
+                Ok(import_queue)
+            },
+        )?
+        .with_rpc_extensions(|builder| -> Result<IoHandler<sc_rpc::Metadata>, _> {
+            let handler = pallet_contracts_rpc::Contracts::new(builder.client().clone());
+            let delegate = pallet_contracts_rpc::ContractsApi::to_delegate(handler);
+
+            let mut io = IoHandler::default();
+            io.extend_with(delegate);
+            Ok(io)
+        })?;
 
-		(builder, import_setup, inherent_data_providers)
-	}}
+        (builder, import_setup, inherent_data_providers)
+    }};
 }
 
 /// Builds a new service for a full client.
-pub fn new_full(config: Configuration)
-	-> Result<impl AbstractService, ServiceError>
-{
-	let role = config.role.clone();
-	let force_authoring = config.force_authoring;
-	let name = config.network.node_name.clone();
-	let disable_grandpa = config.disable_grandpa;
+pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceError> {
+    let role = config.role.clone();
+    let force_authoring = config.force_authoring;
+    let name = config.network.node_name.clone();
+    let disable_grandpa = config.disable_grandpa;
 
-	let (builder, mut import_setup, inherent_data_providers) = new_full_start!(config);
+    let (builder, mut import_setup, inherent_data_providers) = new_full_start!(config);
 
-	let (block_import, grandpa_link) =
-		import_setup.take()
-			.expect("Link Half and Block Import are present for Full Services or setup failed before. qed");
+    let (block_import, grandpa_link) = import_setup.take().expect(
+        "Link Half and Block Import are present for Full Services or setup failed before. qed",
+    );
 
-	let service = builder
-		.with_finality_proof_provider(|client, backend| {
-			// GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
-			let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
-			Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
-		})?
-		.build()?;
+    let service = builder
+        .with_finality_proof_provider(|client, backend| {
+            // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
+            let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
+            Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
+        })?
+        .build()?;
 
-	if role.is_authority() {
-		let proposer =
-			sc_basic_authorship::ProposerFactory::new(service.client(), service.transaction_pool());
+    if role.is_authority() {
+        let proposer = sc_basic_authorship::ProposerFactory::new(
+            service.client(),
+            service.transaction_pool(),
+            service.prometheus_registry().as_ref(),
+        );
 
-		let client = service.client();
-		let select_chain = service.select_chain()
-			.ok_or(ServiceError::SelectChainRequired)?;
+        let client = service.client();
+        let select_chain = service
+            .select_chain()
+            .ok_or(ServiceError::SelectChainRequired)?;
 
-		let can_author_with =
-			sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
+        let can_author_with =
+            sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
 
-		let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _>(
-			sc_consensus_aura::slot_duration(&*client)?,
-			client,
-			select_chain,
-			block_import,
-			proposer,
-			service.network(),
-			inherent_data_providers.clone(),
-			force_authoring,
-			service.keystore(),
-			can_author_with,
-		)?;
+        let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _>(
+            sc_consensus_aura::slot_duration(&*client)?,
+            client,
+            select_chain,
+            block_import,
+            proposer,
+            service.network(),
+            inherent_data_providers.clone(),
+            force_authoring,
+            service.keystore(),
+            can_author_with,
+        )?;
 
-		// the AURA authoring task is considered essential, i.e. if it
-		// fails we take down the service with it.
-		service.spawn_essential_task("aura", aura);
-	}
+        // the AURA authoring task is considered essential, i.e. if it
+        // fails we take down the service with it.
+        service.spawn_essential_task("aura", aura);
+    }
 
-	// if the node isn't actively participating in consensus then it doesn't
-	// need a keystore, regardless of which protocol we use below.
-	let keystore = if role.is_authority() {
-		Some(service.keystore())
-	} else {
-		None
-	};
+    // if the node isn't actively participating in consensus then it doesn't
+    // need a keystore, regardless of which protocol we use below.
+    let keystore = if role.is_authority() {
+        Some(service.keystore())
+    } else {
+        None
+    };
 
-	let grandpa_config = sc_finality_grandpa::Config {
-		// FIXME #1578 make this available through chainspec
-		gossip_duration: Duration::from_millis(333),
-		justification_period: 512,
-		name: Some(name),
-		observer_enabled: false,
-		keystore,
-		is_authority: role.is_network_authority(),
-	};
+    let grandpa_config = sc_finality_grandpa::Config {
+        // FIXME #1578 make this available through chainspec
+        gossip_duration: Duration::from_millis(333),
+        justification_period: 512,
+        name: Some(name),
+        observer_enabled: false,
+        keystore,
+        is_authority: role.is_network_authority(),
+    };
 
-	let enable_grandpa = !disable_grandpa;
-	if enable_grandpa {
-		// start the full GRANDPA voter
-		// NOTE: non-authorities could run the GRANDPA observer protocol, but at
-		// this point the full voter should provide better guarantees of block
-		// and vote data availability than the observer. The observer has not
-		// been tested extensively yet and having most nodes in a network run it
-		// could lead to finality stalls.
-		let grandpa_config = sc_finality_grandpa::GrandpaParams {
-			config: grandpa_config,
-			link: grandpa_link,
-			network: service.network(),
-			inherent_data_providers: inherent_data_providers.clone(),
-			telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
-			voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
-			prometheus_registry: service.prometheus_registry()
-		};
+    let enable_grandpa = !disable_grandpa;
+    if enable_grandpa {
+        // start the full GRANDPA voter
+        // NOTE: non-authorities could run the GRANDPA observer protocol, but at
+        // this point the full voter should provide better guarantees of block
+        // and vote data availability than the observer. The observer has not
+        // been tested extensively yet and having most nodes in a network run it
+        // could lead to finality stalls.
+        let grandpa_config = sc_finality_grandpa::GrandpaParams {
+            config: grandpa_config,
+            link: grandpa_link,
+            network: service.network(),
+            inherent_data_providers: inherent_data_providers.clone(),
+            telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
+            voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
+            prometheus_registry: service.prometheus_registry(),
+            shared_voter_state: SharedVoterState::empty(),
+        };
 
-		// the GRANDPA voter task is considered infallible, i.e.
-		// if it fails we take down the service with it.
-		service.spawn_essential_task(
-			"grandpa-voter",
-			sc_finality_grandpa::run_grandpa_voter(grandpa_config)?
-		);
-	} else {
-		sc_finality_grandpa::setup_disabled_grandpa(
-			service.client(),
-			&inherent_data_providers,
-			service.network(),
-		)?;
-	}
+        // the GRANDPA voter task is considered infallible, i.e.
+        // if it fails we take down the service with it.
+        service.spawn_essential_task(
+            "grandpa-voter",
+            sc_finality_grandpa::run_grandpa_voter(grandpa_config)?,
+        );
+    } else {
+        sc_finality_grandpa::setup_disabled_grandpa(
+            service.client(),
+            &inherent_data_providers,
+            service.network(),
+        )?;
+    }
 
-	Ok(service)
+    Ok(service)
 }
 
 /// Builds a new service for a light client.
-pub fn new_light(config: Configuration)
-	-> Result<impl AbstractService, ServiceError>
-{
-	let inherent_data_providers = InherentDataProviders::new();
+pub fn new_light(config: Configuration) -> Result<impl AbstractService, ServiceError> {
+    let inherent_data_providers = InherentDataProviders::new();
 
-	ServiceBuilder::new_light::<Block, RuntimeApi, Executor>(config)?
-		.with_select_chain(|_config, backend| {
-			Ok(LongestChain::new(backend.clone()))
-		})?
-		.with_transaction_pool(|config, client, fetcher| {
-			let fetcher = fetcher
-				.ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
+    ServiceBuilder::new_light::<Block, RuntimeApi, Executor>(config)?
+        .with_select_chain(|_config, backend| Ok(LongestChain::new(backend.clone())))?
+        .with_transaction_pool(|builder| {
+            let fetcher = builder
+                .fetcher()
+                .ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
 
-			let pool_api = sc_transaction_pool::LightChainApi::new(client.clone(), fetcher.clone());
-			let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
-				config, Arc::new(pool_api), sc_transaction_pool::RevalidationType::Light,
-			);
-			Ok(pool)
-		})?
-		.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _tx_pool| {
-			let fetch_checker = fetcher
-				.map(|fetcher| fetcher.checker().clone())
-				.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
-			let grandpa_block_import = sc_finality_grandpa::light_block_import(
-				client.clone(),
-				backend,
-				&(client.clone() as Arc<_>),
-				Arc::new(fetch_checker),
-			)?;
-			let finality_proof_import = grandpa_block_import.clone();
-			let finality_proof_request_builder =
-				finality_proof_import.create_finality_proof_request_builder();
+            let pool_api =
+                sc_transaction_pool::LightChainApi::new(builder.client().clone(), fetcher.clone());
+            let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
+                builder.config().transaction_pool.clone(),
+                Arc::new(pool_api),
+                builder.prometheus_registry(),
+                sc_transaction_pool::RevalidationType::Light,
+            );
+            Ok(pool)
+        })?
+        .with_import_queue_and_fprb(
+            |_config,
+             client,
+             backend,
+             fetcher,
+             _select_chain,
+             _tx_pool,
+             spawn_task_handle,
+             prometheus_registry| {
+                let fetch_checker = fetcher
+                    .map(|fetcher| fetcher.checker().clone())
+                    .ok_or_else(|| {
+                        "Trying to start light import queue without active fetch checker"
+                    })?;
+                let grandpa_block_import = sc_finality_grandpa::light_block_import(
+                    client.clone(),
+                    backend,
+                    &(client.clone() as Arc<_>),
+                    Arc::new(fetch_checker),
+                )?;
+                let finality_proof_import = grandpa_block_import.clone();
+                let finality_proof_request_builder =
+                    finality_proof_import.create_finality_proof_request_builder();
 
-			let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair>(
-				sc_consensus_aura::slot_duration(&*client)?,
-				grandpa_block_import,
-				None,
-				Some(Box::new(finality_proof_import)),
-				client,
-				inherent_data_providers.clone(),
-			)?;
+                let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>(
+                    sc_consensus_aura::slot_duration(&*client)?,
+                    grandpa_block_import,
+                    None,
+                    Some(Box::new(finality_proof_import)),
+                    client,
+                    inherent_data_providers.clone(),
+                    spawn_task_handle,
+                    prometheus_registry,
+                )?;
 
-			Ok((import_queue, finality_proof_request_builder))
-		})?
-		.with_finality_proof_provider(|client, backend| {
-			// GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
-			let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
-			Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
-		})?
-		.build()
+                Ok((import_queue, finality_proof_request_builder))
+            },
+        )?
+        .with_finality_proof_provider(|client, backend| {
+            // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
+            let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
+            Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
+        })?
+        .build()
 }
modifiedpallets/nft/Cargo.tomldiffbeforeafterboth
--- a/pallets/nft/Cargo.toml
+++ b/pallets/nft/Cargo.toml
@@ -1,52 +1,55 @@
-[package]
-authors = ['Anonymous']
-description = 'FRAME pallet nft'
-edition = '2018'
-homepage = 'https://substrate.dev'
-license = 'Unlicense'
-name = 'pallet-nft'
-repository = 'https://github.com/paritytech/substrate/'
-version = '2.0.0-alpha.6'
-
-[package.metadata.docs.rs]
-targets = ['x86_64-unknown-linux-gnu']
-
 [dependencies.codec]
 default-features = false
 features = ['derive']
 package = 'parity-scale-codec'
 version = '1.3.0'
-
-[dependencies.sp-std]
-default-features = false
-version = '2.0.0-alpha.6'
-
-[dependencies.sp-runtime]
-default-features = false
-version = '2.0.0-alpha.6'
 
 [dependencies.frame-support]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.frame-system]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 [dev-dependencies.sp-core]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dev-dependencies.sp-io]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
+[dependencies.sp-runtime]
+default-features = false
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
+
+[package]
+authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
+description = 'FRAME pallet nft'
+edition = '2018'
+homepage = 'https://substrate.io'
+license = 'Unlicense'
+name = 'pallet-nft'
+repository = 'https://github.com/substrate-developer-hub/nft/'
+version = '2.0.0-rc3'
+[package.metadata.docs.rs]
+targets = ['x86_64-unknown-linux-gnu']
+
 [features]
 default = ['std']
 std = [
     'codec/std',
     'frame-support/std',
     'frame-system/std',
-    "sp-io/std",
-    "sp-runtime/std",
-    'sp-std/std',
+    'sp-runtime/std',
 ]
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -24,7 +24,7 @@
 pub struct CollectionType<AccountId> {
     pub owner: AccountId,
     pub next_item_id: u64,
-    pub name: Vec<u16>, // 64 include null escape char
+    pub name: Vec<u16>,        // 64 include null escape char
     pub description: Vec<u16>, // 256 include null escape char
     pub token_prefix: Vec<u8>, // 16 include null escape char
     pub custom_data_size: u32,
@@ -109,17 +109,17 @@
         //
         // @param customDataSz size of custom data in each collection item
         // returns collection ID
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
-        pub fn create_collection(   origin, 
-                                    collection_name: Vec<u16>, 
-                                    collection_description: Vec<u16>, 
-                                    token_prefix: Vec<u8>, 
+        #[weight = 0]
+        pub fn create_collection(   origin,
+                                    collection_name: Vec<u16>,
+                                    collection_description: Vec<u16>,
+                                    token_prefix: Vec<u8>,
                                     custom_data_sz: u32) -> DispatchResult {
 
             // Anyone can create a collection
             let who = ensure_signed(origin)?;
 
-            // check params 
+            // check params
             let mut name = collection_name.to_vec();
             name.push(0);
             ensure!(name.len() <= 64, "Collection name can not be longer than 63 char");
@@ -158,7 +158,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn destroy_collection(origin, collection_id: u64) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -171,7 +171,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn change_collection_owner(origin, collection_id: u64, new_owner: T::AccountId) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -186,7 +186,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn add_collection_admin(origin, collection_id: u64, new_admin_id: T::AccountId) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -217,7 +217,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn remove_collection_admin(origin, collection_id: u64, account_id: T::AccountId) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -245,7 +245,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn create_item(origin, collection_id: u64, properties: Vec<u8>) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -290,7 +290,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn burn_item(origin, collection_id: u64, item_id: u64) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -327,7 +327,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn transfer(origin, collection_id: u64, item_id: u64, new_owner: T::AccountId) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -374,7 +374,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn approve(origin, approved: T::AccountId, collection_id: u64, item_id: u64) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -417,7 +417,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn transfer_from(origin, collection_id: u64, item_id: u64, new_owner: T::AccountId) -> DispatchResult {
 
             let no_perm_mes = "You do not have permissions to modify this collection";
@@ -430,7 +430,7 @@
             Ok(())
         }
 
-        #[weight = frame_support::weights::SimpleDispatchInfo::default()]
+        #[weight = 0]
         pub fn safe_transfer_from(origin, collection_id: u64, item_id: u64, new_owner: T::AccountId) -> DispatchResult {
 
             let no_perm_mes = "You do not have permissions to modify this collection";
@@ -447,13 +447,10 @@
     }
 }
 
-
 impl<T: Trait> Module<T> {
     fn add_token_index(collection_id: u64, item_index: u64, owner: T::AccountId) -> DispatchResult {
-        
         let list_exists = <AddressTokens<T>>::contains_key((collection_id, owner.clone()));
         if list_exists {
-
             let mut list = <AddressTokens<T>>::get((collection_id, owner.clone()));
             let item_contains = list.contains(&item_index.clone());
 
@@ -462,9 +459,7 @@
             }
 
             <AddressTokens<T>>::insert((collection_id, owner.clone()), list);
-
         } else {
-
             let mut itm = Vec::new();
             itm.push(item_index.clone());
             <AddressTokens<T>>::insert((collection_id, owner), itm);
@@ -473,11 +468,13 @@
         Ok(())
     }
 
-    fn remove_token_index(collection_id: u64, item_index: u64, owner: T::AccountId) -> DispatchResult {
-        
+    fn remove_token_index(
+        collection_id: u64,
+        item_index: u64,
+        owner: T::AccountId,
+    ) -> DispatchResult {
         let list_exists = <AddressTokens<T>>::contains_key((collection_id, owner.clone()));
         if list_exists {
-
             let mut list = <AddressTokens<T>>::get((collection_id, owner.clone()));
             let item_contains = list.contains(&item_index.clone());
 
@@ -490,11 +487,15 @@
         Ok(())
     }
 
-    fn move_token_index(collection_id: u64, item_index: u64, old_owner: T::AccountId, new_owner: T::AccountId) -> DispatchResult {
-        
+    fn move_token_index(
+        collection_id: u64,
+        item_index: u64,
+        old_owner: T::AccountId,
+        new_owner: T::AccountId,
+    ) -> DispatchResult {
         Self::remove_token_index(collection_id, item_index, old_owner)?;
         Self::add_token_index(collection_id, item_index, new_owner)?;
-        
+
         Ok(())
     }
-}
\ No newline at end of file
+}
modifiedpallets/nft/src/tests.rsdiffbeforeafterboth
--- a/pallets/nft/src/tests.rs
+++ b/pallets/nft/src/tests.rs
@@ -5,14 +5,19 @@
 #[test]
 fn create_collection_test() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
 
         let size = 1024;
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
         assert_eq!(TemplateModule::collection(1).owner, 1);
     });
 }
@@ -20,7 +25,6 @@
 #[test]
 fn change_collection_owner() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -28,7 +32,13 @@
         let size = 1024;
         let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
         assert_ok!(TemplateModule::change_collection_owner(
             origin1.clone(),
             1,
@@ -41,7 +51,6 @@
 #[test]
 fn destroy_collection() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -49,7 +58,13 @@
         let size = 1024;
         let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
         assert_ok!(TemplateModule::destroy_collection(origin1.clone(), 1));
     });
 }
@@ -57,7 +72,6 @@
 #[test]
 fn create_item() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -66,7 +80,13 @@
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
         assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
         assert_ok!(TemplateModule::create_item(
             origin2.clone(),
@@ -82,7 +102,6 @@
 #[test]
 fn burn_item() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -91,7 +110,13 @@
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
         assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
         assert_ok!(TemplateModule::create_item(
             origin2.clone(),
@@ -116,7 +141,6 @@
 #[test]
 fn add_collection_admin() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -126,9 +150,27 @@
         let origin2 = Origin::signed(2);
         let origin3 = Origin::signed(3);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin2.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin3.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin2.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin3.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
 
         assert_eq!(TemplateModule::collection(1).owner, 1);
         assert_eq!(TemplateModule::collection(2).owner, 2);
@@ -146,7 +188,6 @@
 #[test]
 fn remove_collection_admin() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -156,9 +197,27 @@
         let origin2 = Origin::signed(2);
         let origin3 = Origin::signed(3);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin2.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin3.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin2.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin3.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
 
         assert_eq!(TemplateModule::collection(1).owner, 1);
         assert_eq!(TemplateModule::collection(2).owner, 2);
@@ -184,7 +243,6 @@
 #[test]
 fn balance_of() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -194,9 +252,27 @@
         let origin2 = Origin::signed(2);
         let origin3 = Origin::signed(3);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin2.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin3.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin2.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin3.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
 
         assert_eq!(TemplateModule::collection(1).owner, 1);
         assert_eq!(TemplateModule::collection(2).owner, 2);
@@ -221,7 +297,6 @@
 #[test]
 fn transfer() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -231,9 +306,27 @@
         let origin2 = Origin::signed(2);
         let origin3 = Origin::signed(3);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin2.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin3.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin2.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin3.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
 
         assert_eq!(TemplateModule::collection(1).owner, 1);
         assert_eq!(TemplateModule::collection(2).owner, 2);
@@ -259,7 +352,6 @@
 #[test]
 fn approve() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -269,9 +361,27 @@
         let origin2 = Origin::signed(2);
         let origin3 = Origin::signed(3);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin2.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin3.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin2.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin3.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
 
         assert_eq!(TemplateModule::collection(1).owner, 1);
         assert_eq!(TemplateModule::collection(2).owner, 2);
@@ -293,7 +403,6 @@
 #[test]
 fn get_approved() {
     new_test_ext().execute_with(|| {
-        
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -303,9 +412,27 @@
         let origin2 = Origin::signed(2);
         let origin3 = Origin::signed(3);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin2.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin3.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin2.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin3.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
 
         assert_eq!(TemplateModule::collection(1).owner, 1);
         assert_eq!(TemplateModule::collection(2).owner, 2);
@@ -327,7 +454,6 @@
 #[test]
 fn transfer_from() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -337,9 +463,27 @@
         let origin2 = Origin::signed(2);
         let origin3 = Origin::signed(3);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin2.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin3.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin2.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin3.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
 
         assert_eq!(TemplateModule::collection(1).owner, 1);
         assert_eq!(TemplateModule::collection(2).owner, 2);
@@ -361,7 +505,6 @@
 #[test]
 fn index_list() {
     new_test_ext().execute_with(|| {
-
         let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
         let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
         let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -371,9 +514,27 @@
         let origin2 = Origin::signed(2);
         let origin3 = Origin::signed(3);
 
-        assert_ok!(TemplateModule::create_collection(origin1.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin2.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
-        assert_ok!(TemplateModule::create_collection(origin3.clone(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), size));
+        assert_ok!(TemplateModule::create_collection(
+            origin1.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin2.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
+        assert_ok!(TemplateModule::create_collection(
+            origin3.clone(),
+            col_name1.clone(),
+            col_desc1.clone(),
+            token_prefix1.clone(),
+            size
+        ));
 
         assert_eq!(TemplateModule::collection(1).owner, 1);
         assert_eq!(TemplateModule::collection(2).owner, 2);
@@ -403,4 +564,3 @@
         assert_eq!(TemplateModule::address_tokens((1, 1))[0], 1);
     });
 }
-
modifiedruntime/Cargo.tomldiffbeforeafterboth
--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -1,12 +1,16 @@
 [dependencies.aura]
 default-features = false
+git = 'https://github.com/paritytech/substrate.git'
 package = 'pallet-aura'
-version = '2.0.0-alpha.6'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.balances]
 default-features = false
+git = 'https://github.com/paritytech/substrate.git'
 package = 'pallet-balances'
-version = '2.0.0-alpha.6'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.codec]
 default-features = false
@@ -15,37 +19,51 @@
 version = '1.3.0'
 
 [dependencies.contracts]
+git = 'https://github.com/paritytech/substrate.git'
 default-features = false
 package = 'pallet-contracts'
-version = '2.0.0-alpha.6'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.contracts-primitives]
+git = 'https://github.com/paritytech/substrate.git'
 default-features = false
 package = 'pallet-contracts-primitives'
-version = '2.0.0-alpha.6'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.contracts-rpc-runtime-api]
+git = 'https://github.com/paritytech/substrate.git'
 default-features = false
 package = 'pallet-contracts-rpc-runtime-api'
-version = '0.8.0-alpha.6'
+version = '0.8.0-rc3'
+tag = 'v2.0.0-rc3'
 
 [dependencies.frame-executive]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.frame-support]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.grandpa]
 default-features = false
+git = 'https://github.com/paritytech/substrate.git'
 package = 'pallet-grandpa'
-version = '2.0.0-alpha.6'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.randomness-collective-flip]
 default-features = false
+git = 'https://github.com/paritytech/substrate.git'
 package = 'pallet-randomness-collective-flip'
-version = '2.0.0-alpha.6'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.serde]
 features = ['derive']
@@ -54,91 +72,123 @@
 
 [dependencies.sp-api]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-block-builder]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-consensus-aura]
 default-features = false
-version = '0.8.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '0.8.0-rc3'
 
 [dependencies.sp-core]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-inherents]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-io]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-offchain]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-runtime]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-session]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-std]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-transaction-pool]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sp-version]
 default-features = false
-version = '2.0.0-alpha.6'
+git = 'https://github.com/paritytech/substrate.git'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.sudo]
 default-features = false
+git = 'https://github.com/paritytech/substrate.git'
 package = 'pallet-sudo'
-version = '2.0.0-alpha.6'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.system]
 default-features = false
+git = 'https://github.com/paritytech/substrate.git'
 package = 'frame-system'
-version = '2.0.0-alpha.6'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.nft]
 default-features = false
 package = 'pallet-nft'
 path = '../pallets/nft'
-version = '2.0.0-alpha.6'
+version = '2.0.0-rc3'
 
 [dependencies.timestamp]
 default-features = false
+git = 'https://github.com/paritytech/substrate.git'
 package = 'pallet-timestamp'
-version = '2.0.0-alpha.6'
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 
 [dependencies.transaction-payment]
 default-features = false
+git = 'https://github.com/paritytech/substrate.git'
 package = 'pallet-transaction-payment'
-version = '2.0.0-alpha.6'
-
+tag = 'v2.0.0-rc3'
+version = '2.0.0-rc3'
 [build-dependencies.wasm-builder-runner]
+git = 'https://github.com/paritytech/substrate.git'
 package = 'substrate-wasm-builder-runner'
+tag = 'v2.0.0-rc3'
 version = '1.0.5'
 
 [package]
-authors = ['Anonymous']
+authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
 edition = '2018'
-homepage = 'https://substrate.dev'
+homepage = 'https://substrate.io'
 license = 'Unlicense'
 name = 'nft-runtime'
-repository = 'https://github.com/paritytech/substrate/'
-version = '2.0.0-alpha.6'
-
+repository = 'https://github.com/usetech-llc/nft_parachain/'
+version = '2.0.0-rc3'
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
 
@@ -148,9 +198,9 @@
     'aura/std',
     'balances/std',
     'codec/std',
-	"contracts/std",
-	"contracts-primitives/std",
-	"contracts-rpc-runtime-api/std",
+    'contracts/std',
+    'contracts-primitives/std',
+    'contracts-rpc-runtime-api/std',
     'frame-executive/std',
     'frame-support/std',
     'grandpa/std',
modifiedruntime/build.rsdiffbeforeafterboth
--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -3,7 +3,7 @@
 fn main() {
 	WasmBuilder::new()
 		.with_current_project()
-		.with_wasm_builder_from_crates("1.0.9")
+		.with_wasm_builder_from_crates("1.0.11")
 		.export_heap_base()
 		.import_memory()
 		.build()
modifiedruntime/src/lib.rsdiffbeforeafterboth
--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -9,18 +9,19 @@
 include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
 
 use grandpa::fg_primitives;
-use grandpa::AuthorityList as GrandpaAuthorityList;
+use grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
 use sp_api::impl_runtime_apis;
 use sp_consensus_aura::sr25519::AuthorityId as AuraId;
-use sp_core::OpaqueMetadata;
+use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
 use sp_runtime::traits::{
-    BlakeTwo256, Block as BlockT, ConvertInto, IdentifyAccount, IdentityLookup, Verify,
+    BlakeTwo256, Block as BlockT, IdentifyAccount, IdentityLookup, NumberFor, Saturating, Verify,
 };
 use sp_runtime::{
     create_runtime_str, generic, impl_opaque_keys,
     transaction_validity::{TransactionSource, TransactionValidity},
     ApplyExtrinsicResult, MultiSignature,
 };
+use contracts_rpc_runtime_api::ContractExecResult;
 use sp_std::prelude::*;
 #[cfg(feature = "std")]
 use sp_version::NativeVersion;
@@ -28,19 +29,22 @@
 
 // A few exports that help ease life for downstream crates.
 pub use balances::Call as BalancesCall;
+pub use contracts::Schedule as ContractsSchedule;
 pub use frame_support::{
-    construct_runtime, parameter_types, traits::Randomness, weights::Weight, StorageValue,
+    construct_runtime, parameter_types,
+    traits::{KeyOwnerProofSystem, Randomness},
+    weights::{
+        constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
+        IdentityFee, Weight,
+    },
+    StorageValue,
 };
 #[cfg(any(feature = "std", test))]
 pub use sp_runtime::BuildStorage;
 pub use sp_runtime::{Perbill, Permill};
 pub use timestamp::Call as TimestampCall;
-pub use contracts::Schedule as ContractsSchedule;
-pub use contracts_rpc_runtime_api::{
-	self as runtime_api, ContractExecResult
-};
 
-/// Importing a template pallet
+/// Importing a nft pallet
 pub use nft;
 
 /// An index to a block.
@@ -101,6 +105,7 @@
     spec_version: 1,
     impl_version: 1,
     apis: RUNTIME_API_VERSIONS,
+    transaction_version: 1,
 };
 
 pub const MILLISECS_PER_BLOCK: u64 = 6000;
@@ -122,9 +127,13 @@
 }
 
 parameter_types! {
-    pub const BlockHashCount: BlockNumber = 250;
-    pub const MaximumBlockWeight: Weight = 1_000_000_000;
+    pub const BlockHashCount: BlockNumber = 2400;
+    /// We allow for 2 seconds of compute with a 6 second average block time.
+    pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
     pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
+    /// Assume 10% of weight for average on_initialize calls.
+    pub MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get()
+        .saturating_sub(Perbill::from_percent(10)) * MaximumBlockWeight::get();
     pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
     pub const Version: RuntimeVersion = VERSION;
 }
@@ -154,6 +163,18 @@
     type BlockHashCount = BlockHashCount;
     /// Maximum weight of each block.
     type MaximumBlockWeight = MaximumBlockWeight;
+    /// The weight of database operations that the runtime can invoke.
+    type DbWeight = RocksDbWeight;
+    /// The weight of the overhead invoked on the block import process, independent of the
+    /// extrinsics included in that block.
+    type BlockExecutionWeight = BlockExecutionWeight;
+    /// The base weight of any extrinsic processed by the runtime, independent of the
+    /// logic of that extrinsic. (Signature verification, nonce increment, fee, etc...)
+    type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
+    /// The maximum weight that a single extrinsic of `Normal` dispatch class can have,
+    /// idependent of the logic of that extrinsics. (Roughly max block weight - average on
+    /// initialize cost).
+    type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
     /// Maximum size of all encoded transactions (in bytes) that are allowed in one block.
     type MaximumBlockLength = MaximumBlockLength;
     /// Portion of the block weight that is available to all normal transactions.
@@ -178,6 +199,19 @@
 
 impl grandpa::Trait for Runtime {
     type Event = Event;
+    type Call = Call;
+
+    type KeyOwnerProofSystem = ();
+
+    type KeyOwnerProof =
+        <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
+
+    type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
+        KeyTypeId,
+        GrandpaId,
+    )>>::IdentificationTuple;
+
+    type HandleEquivocation = ();
 }
 
 parameter_types! {
@@ -205,59 +239,40 @@
     type AccountStore = System;
 }
 
-// Contracts price units.
-pub const MILLICENTS: Balance = 1_000_000_000;
-pub const CENTS: Balance = 1_000 * MILLICENTS;
-pub const DOLLARS: Balance = 100 * CENTS;
-
 parameter_types! {
-    pub const TombstoneDeposit: Balance = 16 * MILLICENTS;
-    pub const RentByteFee: Balance = 4 * MILLICENTS;
-    pub const RentDepositOffset: Balance = 1000 * MILLICENTS;
-	pub const SurchargeReward: Balance = 150 * MILLICENTS;
-	pub const ContractTransactionBaseFee: Balance = 1 * CENTS;
-	pub const ContractTransactionByteFee: Balance = 10 * MILLICENTS;
-	pub const ContractFee: Balance = 1 * CENTS;
+    pub const TombstoneDeposit: Balance = 1;
+    pub const RentByteFee: Balance = 1;
+    pub const RentDepositOffset: Balance = 1000;
+    pub const SurchargeReward: Balance = 150;
 }
 
 impl contracts::Trait for Runtime {
-	type Currency = Balances;
-	type Time = Timestamp;
-	type Randomness = RandomnessCollectiveFlip;
-	type Call = Call;
-	type Event = Event;
-	type DetermineContractAddress = contracts::SimpleAddressDeterminer<Runtime>;
-	type ComputeDispatchFee = contracts::DefaultDispatchFeeComputor<Runtime>;
-	type TrieIdGenerator = contracts::TrieIdFromParentCounter<Runtime>;
-	type GasPayment = ();
-	type RentPayment = ();
-	type SignedClaimHandicap = contracts::DefaultSignedClaimHandicap;
-	type TombstoneDeposit = TombstoneDeposit;
-	type StorageSizeOffset = contracts::DefaultStorageSizeOffset;
-	type RentByteFee = RentByteFee;
-	type RentDepositOffset = RentDepositOffset;
-	type SurchargeReward = SurchargeReward;
-	type TransactionBaseFee = ContractTransactionBaseFee;
-	type TransactionByteFee = ContractTransactionByteFee;
-	type ContractFee = ContractFee;
-	type CallBaseFee = contracts::DefaultCallBaseFee;
-	type InstantiateBaseFee = contracts::DefaultInstantiateBaseFee;
-	type MaxDepth = contracts::DefaultMaxDepth;
-	type MaxValueSize = contracts::DefaultMaxValueSize;
-	type BlockGasLimit = contracts::DefaultBlockGasLimit;
+    type Time = Timestamp;
+    type Randomness = RandomnessCollectiveFlip;
+    type Call = Call;
+    type Event = Event;
+    type DetermineContractAddress = contracts::SimpleAddressDeterminer<Runtime>;
+    type TrieIdGenerator = contracts::TrieIdFromParentCounter<Runtime>;
+    type RentPayment = ();
+    type SignedClaimHandicap = contracts::DefaultSignedClaimHandicap;
+    type TombstoneDeposit = TombstoneDeposit;
+    type StorageSizeOffset = contracts::DefaultStorageSizeOffset;
+    type RentByteFee = RentByteFee;
+    type RentDepositOffset = RentDepositOffset;
+    type SurchargeReward = SurchargeReward;
+    type MaxDepth = contracts::DefaultMaxDepth;
+    type MaxValueSize = contracts::DefaultMaxValueSize;
 }
 
 parameter_types! {
-    pub const TransactionBaseFee: Balance = 0;
     pub const TransactionByteFee: Balance = 1;
 }
 
 impl transaction_payment::Trait for Runtime {
     type Currency = balances::Module<Runtime>;
     type OnTransactionPayment = ();
-    type TransactionBaseFee = TransactionBaseFee;
     type TransactionByteFee = TransactionByteFee;
-    type WeightToFee = ConvertInto;
+    type WeightToFee = IdentityFee<Balance>;
     type FeeMultiplierUpdate = ();
 }
 
@@ -266,7 +281,7 @@
     type Call = Call;
 }
 
-/// Used for the module template in `./template.rs`
+/// Used for the module nft in `./nft.rs`
 impl nft::Trait for Runtime {
     type Event = Event;
 }
@@ -275,18 +290,17 @@
     pub enum Runtime where
         Block = Block,
         NodeBlock = opaque::Block,
-        UncheckedExtrinsic = UncheckedExtrinsic,
+        UncheckedExtrinsic = UncheckedExtrinsic
     {
         System: system::{Module, Call, Config, Storage, Event<T>},
         RandomnessCollectiveFlip: randomness_collective_flip::{Module, Call, Storage},
+        Contracts: contracts::{Module, Call, Config, Storage, Event<T>},
         Timestamp: timestamp::{Module, Call, Storage, Inherent},
         Aura: aura::{Module, Config<T>, Inherent(Timestamp)},
         Grandpa: grandpa::{Module, Call, Storage, Config, Event},
         Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
         TransactionPayment: transaction_payment::{Module, Storage},
-		Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},
-		Contracts: contracts::{Module, Call, Config<T>, Storage, Event<T>},
-        // Used for the module template in `./template.rs`
+        Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},
         Nft: nft::{Module, Call, Storage, Event<T>},
     }
 );
@@ -303,7 +317,8 @@
 pub type BlockId = generic::BlockId<Block>;
 /// The SignedExtension to the basic transaction logic.
 pub type SignedExtra = (
-    system::CheckVersion<Runtime>,
+    system::CheckSpecVersion<Runtime>,
+    system::CheckTxVersion<Runtime>,
     system::CheckGenesis<Runtime>,
     system::CheckEra<Runtime>,
     system::CheckNonce<Runtime>,
@@ -319,6 +334,42 @@
     frame_executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
 
 impl_runtime_apis! {
+
+    impl contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>
+    for Runtime
+    {
+        fn call(
+            origin: AccountId,
+            dest: AccountId,
+            value: Balance,
+            gas_limit: u64,
+            input_data: Vec<u8>,
+        ) -> ContractExecResult {
+            let exec_result =
+                Contracts::bare_call(origin, dest.into(), value, gas_limit, input_data);
+            match exec_result {
+                Ok(v) => ContractExecResult::Success {
+                    status: v.status,
+                    data: v.data,
+                },
+                Err(_) => ContractExecResult::Error,
+            }
+        }
+
+        fn get_storage(
+            address: AccountId,
+            key: [u8; 32],
+        ) -> contracts_primitives::GetStorageResult {
+            Contracts::get_storage(address, key)
+        }
+
+        fn rent_projection(
+            address: AccountId,
+        ) -> contracts_primitives::RentProjectionResult<BlockNumber> {
+            Contracts::rent_projection(address)
+        }
+    }
+
     impl sp_api::Core<Block> for Runtime {
         fn version() -> RuntimeVersion {
             VERSION
@@ -396,7 +447,7 @@
 
         fn decode_session_keys(
             encoded: Vec<u8>,
-        ) -> Option<Vec<(Vec<u8>, sp_core::crypto::KeyTypeId)>> {
+        ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {
             opaque::SessionKeys::decode_into_raw_public_keys(&encoded)
         }
     }
@@ -405,40 +456,25 @@
         fn grandpa_authorities() -> GrandpaAuthorityList {
             Grandpa::grandpa_authorities()
         }
-    }
 
-    impl contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>
-        for Runtime
-	{
-		fn call(
-			origin: AccountId,
-			dest: AccountId,
-			value: Balance,
-			gas_limit: u64,
-			input_data: Vec<u8>,
-		) -> ContractExecResult {
-			let exec_result =
-				Contracts::bare_call(origin, dest.into(), value, gas_limit, input_data);
-			match exec_result {
-                Ok(v) => ContractExecResult::Success {
-                    status: v.status,
-                    data: v.data,
-                },
-				Err(_) => ContractExecResult::Error,
-			}
-		}
-
-		fn get_storage(
-			address: AccountId,
-			key: [u8; 32],
-		) -> contracts_primitives::GetStorageResult {
-			Contracts::get_storage(address, key)
-		}
+        fn submit_report_equivocation_extrinsic(
+            _equivocation_proof: fg_primitives::EquivocationProof<
+                <Block as BlockT>::Hash,
+                NumberFor<Block>,
+            >,
+            _key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,
+        ) -> Option<()> {
+            None
+        }
 
-		fn rent_projection(
-			address: AccountId,
-		) -> contracts_primitives::RentProjectionResult<BlockNumber> {
-			Contracts::rent_projection(address)
-		}
-	}
+        fn generate_key_ownership_proof(
+            _set_id: fg_primitives::SetId,
+            _authority_id: GrandpaId,
+        ) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {
+            // NOTE: this is the only implementation possible since we've
+            // defined our key owner proof type as a bottom type (i.e. a type
+            // with no values).
+            None
+        }
+    }
 }