git.delta.rocks / unique-network / refs/commits / 8def008a5054

difftreelog

refactor disable contracts in runtime

Yaroslav Bolyukin2021-07-08parent: #d412fe4.patch.diff
in: master

2 files changed

modifiedruntime/Cargo.tomldiffbeforeafterboth
43 'frame-system-rpc-runtime-api/std',43 'frame-system-rpc-runtime-api/std',
44 'pallet-aura/std',44 'pallet-aura/std',
45 'pallet-balances/std',45 'pallet-balances/std',
46 'pallet-contracts/std',46 # 'pallet-contracts/std',
47 'pallet-contracts-primitives/std',47 # 'pallet-contracts-primitives/std',
48 'pallet-contracts-rpc-runtime-api/std',48 # 'pallet-contracts-rpc-runtime-api/std',
49 'pallet-contract-helpers/std',49 # 'pallet-contract-helpers/std',
50 'pallet-randomness-collective-flip/std',50 'pallet-randomness-collective-flip/std',
51 'pallet-sudo/std',51 'pallet-sudo/std',
52 'pallet-timestamp/std',52 'pallet-timestamp/std',
152version = '3.0.0'152version = '3.0.0'
153153
154# Contracts specific packages154# Contracts specific packages
155[dependencies.pallet-contracts]155# [dependencies.pallet-contracts]
156git = 'https://github.com/paritytech/substrate.git'156# git = 'https://github.com/paritytech/substrate.git'
157default-features = false157# default-features = false
158branch = 'polkadot-v0.9.7'158# branch = 'polkadot-v0.9.7'
159version = '3.0.0'159# version = '3.0.0'
160160
161[dependencies.pallet-contracts-primitives]161# [dependencies.pallet-contracts-primitives]
162git = 'https://github.com/paritytech/substrate.git'162# git = 'https://github.com/paritytech/substrate.git'
163default-features = false163# default-features = false
164branch = 'polkadot-v0.9.7'164# branch = 'polkadot-v0.9.7'
165version = '3.0.0'165# version = '3.0.0'
166166
167[dependencies.pallet-contracts-rpc-runtime-api]167# [dependencies.pallet-contracts-rpc-runtime-api]
168git = 'https://github.com/paritytech/substrate.git'168# git = 'https://github.com/paritytech/substrate.git'
169default-features = false169# default-features = false
170branch = 'polkadot-v0.9.7'170# branch = 'polkadot-v0.9.7'
171version = '3.0.0'171# version = '3.0.0'
172172
173[dependencies.pallet-randomness-collective-flip]173[dependencies.pallet-randomness-collective-flip]
174default-features = false174default-features = false
380pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }380pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }
381nft-data-structs = { path = '../primitives/nft', default-features = false, version = '0.9.0' }381nft-data-structs = { path = '../primitives/nft', default-features = false, version = '0.9.0' }
382pallet-scheduler = { path = '../pallets/scheduler', default-features = false, version = '3.0.0' }382pallet-scheduler = { path = '../pallets/scheduler', default-features = false, version = '3.0.0' }
383pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }383# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
384pallet-nft-transaction-payment = { path = '../pallets/nft-transaction-payment', default-features = false, version = '3.0.0' }384pallet-nft-transaction-payment = { path = '../pallets/nft-transaction-payment', default-features = false, version = '3.0.0' }
385pallet-nft-charge-transaction = { path = '../pallets/nft-charge-transaction', default-features = false, version = '3.0.0' }385pallet-nft-charge-transaction = { path = '../pallets/nft-charge-transaction', default-features = false, version = '3.0.0' }
386386
modifiedruntime/src/lib.rsdiffbeforeafterboth
--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -55,7 +55,7 @@
 	},
 };
 use nft_data_structs::*;
-use pallet_contracts::weights::WeightInfo;
+// use pallet_contracts::weights::WeightInfo;
 // #[cfg(any(feature = "std", test))]
 use frame_system::{
 	self as system, EnsureRoot, EnsureSigned,
@@ -72,9 +72,9 @@
 use sp_runtime::{
 	traits::{Dispatchable},
 };
-use pallet_contracts::chain_extension::UncheckedFrom;
+// use pallet_contracts::chain_extension::UncheckedFrom;
 
-pub use pallet_timestamp::Call as TimestampCall;
+// pub use pallet_timestamp::Call as TimestampCall;
 pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
 
 // Polkadot imports
@@ -91,18 +91,9 @@
 };
 use xcm_executor::{Config, XcmExecutor};
 
-mod chain_extension;
-use crate::chain_extension::{NFTExtension, Imbalance};
+// mod chain_extension;
+// use crate::chain_extension::{NFTExtension, Imbalance};
 
-/// Re-export a nft pallet
-/// TODO: Check this re-export. Is this safe and good style?
-// extern crate pallet_nft;
-// pub use pallet_nft::*;
-
-/// Reimport pallet inflation
-// extern crate pallet_inflation;
-// pub use pallet_inflation::*;
-
 /// An index to a block.
 pub type BlockNumber = u32;
 
@@ -379,6 +370,7 @@
 	items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE
 }
 
+/*
 parameter_types! {
 	pub TombstoneDeposit: Balance = deposit(
 		1,
@@ -418,17 +410,15 @@
 	type DepositPerStorageItem = DepositPerStorageItem;
 	type RentFraction = RentFraction;
 	type SurchargeReward = SurchargeReward;
-	// type MaxDepth = MaxDepth;
-	// type MaxValueSize = MaxValueSize;
 	type WeightPrice = pallet_transaction_payment::Module<Self>;
 	type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;
 	type ChainExtension = NFTExtension;
 	type DeletionQueueDepth = DeletionQueueDepth;
 	type DeletionWeightLimit = DeletionWeightLimit;
-	// type MaxCodeSize = MaxCodeSize;
 	type Schedule = Schedule;
 	type CallStack = [pallet_contracts::Frame<Self>; 31];
 }
+*/
 
 parameter_types! {
 	pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; // Targeting 0.1 Unique per NFT transfer
@@ -724,10 +714,7 @@
 	fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>
 	where
 		Call: Dispatchable<Info = DispatchInfo>,
-		Call: IsSubType<pallet_nft::Call<Runtime>>,
-		Call: IsSubType<pallet_contracts::Call<Runtime>>,
 		AccountId: AsRef<[u8]>,
-		AccountId: UncheckedFrom<Hash>,
 	{
 		pallet_nft_transaction_payment::Module::<Runtime>::withdraw_type(who, call)
 	}
@@ -735,7 +722,7 @@
 
 type SponsorshipHandler = (
 	pallet_nft::NftSponsorshipHandler<Runtime>,
-	pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,
+	//pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,
 );
 
 impl pallet_scheduler::Config for Runtime {
@@ -756,7 +743,7 @@
 
 impl pallet_nft_charge_transaction::Config for Runtime {}
 
-impl pallet_contract_helpers::Config for Runtime {}
+// impl pallet_contract_helpers::Config for Runtime {}
 
 construct_runtime!(
 	pub enum Runtime where
@@ -765,7 +752,7 @@
 		UncheckedExtrinsic = UncheckedExtrinsic
 	{
 		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
-		Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>},
+		// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>},
 		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},
 		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
 		TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
@@ -797,7 +784,7 @@
 		Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>},
 		NftPayment: pallet_nft_transaction_payment::{Pallet, Call, Storage},
 		Charging: pallet_nft_charge_transaction::{Pallet, Call, Storage },
-		ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage},
+		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage},
 	}
 );
 
@@ -844,7 +831,7 @@
 	system::CheckNonce<Runtime>,
 	system::CheckWeight<Runtime>,
 	pallet_nft_charge_transaction::ChargeTransactionPayment<Runtime>,
-	pallet_contract_helpers::ContractHelpersExtension<Runtime>,
+	//pallet_contract_helpers::ContractHelpersExtension<Runtime>,
 );
 /// Unchecked extrinsic type as expected by this runtime.
 pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
@@ -1087,6 +1074,7 @@
 		}
 	}
 
+	/*
 	impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash>
 		for Runtime
 	{
@@ -1125,6 +1113,7 @@
 			Contracts::rent_projection(address)
 		}
 	}
+	*/
 
 	#[cfg(feature = "runtime-benchmarks")]
 	impl frame_benchmarking::Benchmark<Block> for Runtime {