git.delta.rocks / unique-network / refs/commits / 0045b0b0382f

difftreelog

fix build with unique/quartz runtimes

Yaroslav Bolyukin2022-06-03parent: #9b326fd.patch.diff
in: master

3 files changed

modifiednode/cli/src/command.rsdiffbeforeafterboth
374 }374 }
375 #[cfg(feature = "unique-runtime")]375 #[cfg(feature = "unique-runtime")]
376 Some(Subcommand::Benchmark(cmd)) => {376 Some(Subcommand::Benchmark(cmd)) => {
377 use frame_benchmarking_cli::BenchmarkCmd;377 use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
378 let runner = cli.create_runner(cmd)?;378 let runner = cli.create_runner(cmd)?;
379 // Switch on the concrete benchmark sub-command-379 // Switch on the concrete benchmark sub-command-
380 match cmd {380 match cmd {
406406
407 cmd.run(config, partials.client.clone(), db, storage)407 cmd.run(config, partials.client.clone(), db, storage)
408 }),408 }),
409 BenchmarkCmd::Machine(cmd) => runner.sync_run(|config| cmd.run(&config)),409 BenchmarkCmd::Machine(cmd) => {
410 runner.sync_run(|config| cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()))
411 }
410 BenchmarkCmd::Overhead(_) => Err("Unsupported benchmarking command".into()),412 BenchmarkCmd::Overhead(_) => Err("Unsupported benchmarking command".into()),
411 }413 }
412 }414 }
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -66,7 +66,6 @@
 		WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,
 	},
 };
-use up_data_structs::*;
 // use pallet_contracts::weights::WeightInfo;
 // #[cfg(any(feature = "std", test))]
 use frame_system::{
@@ -82,7 +81,7 @@
 use fp_rpc::TransactionStatus;
 use sp_runtime::{
 	traits::{
-		Applyable, BlockNumberProvider, Dispatchable, PostDispatchInfoOf, Saturating,
+		Applyable, BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating,
 		CheckedConversion,
 	},
 	generic::Era,
@@ -246,8 +245,8 @@
 
 pub struct FixedFee;
 impl FeeCalculator for FixedFee {
-	fn min_gas_price() -> U256 {
-		MIN_GAS_PRICE.into()
+	fn min_gas_price() -> (U256, u64) {
+		(MIN_GAS_PRICE.into(), 0)
 	}
 }
 
@@ -862,8 +861,8 @@
 }
 
 impl pallet_common::Config for Runtime {
+	type WeightInfo = pallet_common::weights::SubstrateWeight<Self>;
 	type Event = Event;
-
 	type Currency = Balances;
 	type CollectionCreationPrice = CollectionCreationPrice;
 	type TreasuryAccountId = TreasuryAccountId;
@@ -1249,9 +1248,14 @@
 		}
 	}
 
-	fn validate_self_contained(&self, info: &Self::SignedInfo) -> Option<TransactionValidity> {
+	fn validate_self_contained(
+		&self,
+		info: &Self::SignedInfo,
+		dispatch_info: &DispatchInfoOf<Call>,
+		len: usize,
+	) -> Option<TransactionValidity> {
 		match self {
-			Call::Ethereum(call) => call.validate_self_contained(info),
+			Call::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len),
 			_ => None,
 		}
 	}
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -35,7 +35,7 @@
 	Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys,
 	generic::Era,
 	traits::{
-		Applyable, BlockNumberProvider, Dispatchable, PostDispatchInfoOf, Saturating,
+		Applyable, BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating,
 		CheckedConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion,
 		Zero, Member,
 	},
@@ -75,14 +75,7 @@
 		DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
 		WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,
 	},
-};
-use unique_runtime_common::{
-	dispatch::{CollectionDispatchT, CollectionDispatch},
-	weights::CommonWeights,
-	sponsoring::UniqueSponsorshipHandler,
-	eth_sponsoring::UniqueEthSponsorshipHandler,
 };
-use up_data_structs::*;
 // use pallet_contracts::weights::WeightInfo;
 // #[cfg(any(feature = "std", test))]
 use frame_system::{
@@ -124,7 +117,6 @@
 	Error as XcmError,
 };
 use xcm_executor::traits::{MatchesFungible, WeightTrader};
-use sp_runtime::traits::CheckedConversion;
 
 use unique_runtime_common::{
 	impl_common_runtime_apis,
@@ -248,8 +240,8 @@
 
 pub struct FixedFee;
 impl FeeCalculator for FixedFee {
-	fn min_gas_price() -> U256 {
-		MIN_GAS_PRICE.into()
+	fn min_gas_price() -> (U256, u64) {
+		(MIN_GAS_PRICE.into(), 0)
 	}
 }
 
@@ -1250,9 +1242,14 @@
 		}
 	}
 
-	fn validate_self_contained(&self, info: &Self::SignedInfo) -> Option<TransactionValidity> {
+	fn validate_self_contained(
+		&self,
+		info: &Self::SignedInfo,
+		dispatch_info: &DispatchInfoOf<Call>,
+		len: usize,
+	) -> Option<TransactionValidity> {
 		match self {
-			Call::Ethereum(call) => call.validate_self_contained(info),
+			Call::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len),
 			_ => None,
 		}
 	}