difftreelog
fix make runtime build on 0.9.42
in: master
11 files changed
Cargo.lockdiffbeforeafterboth13701dependencies = [13701dependencies = [13702 "app-promotion-rpc",13702 "app-promotion-rpc",13703 "fc-db",13703 "fc-db",13704 "fc-mapping-sync",13704 "fc-rpc",13705 "fc-rpc",13705 "fc-rpc-core",13706 "fc-rpc-core",13706 "fp-rpc",13707 "fp-rpc",runtime/common/config/ethereum.rsdiffbeforeafterboth4 traits::{FindAuthor},4 traits::{FindAuthor},5 parameter_types, ConsensusEngineId,5 parameter_types, ConsensusEngineId,6};6};7use sp_runtime::{RuntimeAppPublic, Perbill};7use sp_runtime::{RuntimeAppPublic, Perbill, traits::ConstU32};8use crate::{8use crate::{9 runtime_common::{9 runtime_common::{10 config::sponsoring::DefaultSponsoringRateLimit,10 config::sponsoring::DefaultSponsoringRateLimit,84 type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter<Balances, DealWithFees>;84 type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter<Balances, DealWithFees>;85 type TransactionValidityHack = pallet_evm_transaction_payment::TransactionValidityHack<Self>;85 type TransactionValidityHack = pallet_evm_transaction_payment::TransactionValidityHack<Self>;86 type FindAuthor = EthereumFindAuthor<Aura>;86 type FindAuthor = EthereumFindAuthor<Aura>;87 type Timestamp = crate::Timestamp;88 type WeightInfo = pallet_evm::weights::SubstrateWeight<Self>;87}89}889089impl pallet_evm_migration::Config for Runtime {91impl pallet_evm_migration::Config for Runtime {99 type RuntimeEvent = RuntimeEvent;101 type RuntimeEvent = RuntimeEvent;100 type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;102 type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;101 type PostLogContent = PostBlockAndTxnHashes;103 type PostLogContent = PostBlockAndTxnHashes;104 // Space for revert reason. Ethereum transactions are not cheap, and overall size is much less105 // than the substrate tx size, so we can afford this106 type ExtraDataLength = ConstU32<32>;102}107}103108104parameter_types! {109parameter_types! {runtime/common/config/substrate.rsdiffbeforeafterboth36use pallet_transaction_payment::{Multiplier, ConstFeeMultiplier};36use pallet_transaction_payment::{Multiplier, ConstFeeMultiplier};37use crate::{37use crate::{38 runtime_common::DealWithFees, Runtime, RuntimeEvent, RuntimeCall, RuntimeOrigin, PalletInfo,38 runtime_common::DealWithFees, Runtime, RuntimeEvent, RuntimeCall, RuntimeOrigin, PalletInfo,39 System, Balances, Treasury, SS58Prefix, Version,39 System, Balances, SS58Prefix, Version,40};40};41use up_common::{types::*, constants::*};41use up_common::{types::*, constants::*};4242142 type Balance = Balance;142 type Balance = Balance;143 /// The ubiquitous event type.143 /// The ubiquitous event type.144 type RuntimeEvent = RuntimeEvent;144 type RuntimeEvent = RuntimeEvent;145 // FIXME: Is () the new treasury?145 type DustRemoval = Treasury;146 type DustRemoval = ();146 type ExistentialDeposit = ExistentialDeposit;147 type ExistentialDeposit = ExistentialDeposit;147 type AccountStore = System;148 type AccountStore = System;148 type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;149 type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;150 type HoldIdentifier = [u8; 16];151 type FreezeIdentifier = [u8; 16];152 type MaxHolds = ();153 type MaxFreezes = ();149}154}150155151parameter_types! {156parameter_types! {runtime/common/config/xcm/mod.rsdiffbeforeafterboth15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617use frame_support::{17use frame_support::{18 traits::{Everything, Nothing, Get, ConstU32},18 traits::{Everything, Nothing, Get, ConstU32, ProcessMessageError},19 parameter_types,19 parameter_types,20};20};21use frame_system::EnsureRoot;21use frame_system::EnsureRoot;114);114);115115116pub trait TryPass {116pub trait TryPass {117<<<<<<< HEAD118 fn try_pass<Call>(origin: &MultiLocation, message: &mut [Instruction<Call>]) -> Result<(), ()>;119=======120 fn try_pass<Call>(117 fn try_pass<Call>(121 origin: &MultiLocation,118 origin: &MultiLocation,122 message: &mut [Instruction<Call>],119 message: &mut [Instruction<Call>],123 ) -> Result<(), ProcessMessageError>;120 ) -> Result<(), ProcessMessageError>;124>>>>>>> fd33b0ac (fixup pallets)125}121}126122127#[impl_trait_for_tuples::impl_for_tuples(30)]123#[impl_trait_for_tuples::impl_for_tuples(30)]128impl TryPass for Tuple {124impl TryPass for Tuple {129<<<<<<< HEAD130 fn try_pass<Call>(origin: &MultiLocation, message: &mut [Instruction<Call>]) -> Result<(), ()> {131=======132 fn try_pass<Call>(125 fn try_pass<Call>(133 origin: &MultiLocation,126 origin: &MultiLocation,134 message: &mut [Instruction<Call>],127 message: &mut [Instruction<Call>],135 ) -> Result<(), ProcessMessageError> {128 ) -> Result<(), ProcessMessageError> {136>>>>>>> fd33b0ac (fixup pallets)137 for_tuples!( #(129 for_tuples!( #(138 Tuple::try_pass(origin, message)?;130 Tuple::try_pass(origin, message)?;139 )* );131 )* );159 message: &mut [Instruction<Call>],151 message: &mut [Instruction<Call>],160 max_weight: Weight,152 max_weight: Weight,161 weight_credit: &mut Weight,153 weight_credit: &mut Weight,162 ) -> Result<(), ()> {154 ) -> Result<(), ProcessMessageError> {163 Deny::try_pass(origin, message)?;155 Deny::try_pass(origin, message)?;164 Allow::should_execute(origin, message, max_weight, weight_credit)156 Allow::should_execute(origin, message, max_weight, weight_credit)165 }157 }227 type SovereignAccountOf = LocationToAccountId;219 type SovereignAccountOf = LocationToAccountId;228 type MaxLockers = ConstU32<8>;220 type MaxLockers = ConstU32<8>;229 type WeightInfo = crate::weights::xcm::SubstrateWeight<Runtime>;221 type WeightInfo = crate::weights::xcm::SubstrateWeight<Runtime>;222 type AdminOrigin = EnsureRoot<AccountId>;230 #[cfg(feature = "runtime-benchmarks")]223 #[cfg(feature = "runtime-benchmarks")]231 type ReachableDest = ReachableDest;224 type ReachableDest = ReachableDest;232}225}runtime/common/config/xcm/nativeassets.rsdiffbeforeafterboth102 for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>102 for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>103{103{104 fn new() -> Self {104 fn new() -> Self {105 // FIXME: benchmark105 Self(0, Zero::zero(), PhantomData)106 Self(Weight::from_parts(0, 0), Zero::zero(), PhantomData)106 }107 }107108108 fn buy_weight(&mut self, _weight: Weight, payment: Assets) -> Result<Assets, XcmError> {109 fn buy_weight(&mut self, _weight: Weight, payment: Assets) -> Result<Assets, XcmError> {runtime/common/runtime_apis.rsdiffbeforeafterboth35 ) => {35 ) => {36 use sp_std::prelude::*;36 use sp_std::prelude::*;37 use sp_api::impl_runtime_apis;37 use sp_api::impl_runtime_apis;38 use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160, Bytes};38 use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160};39 use sp_runtime::{39 use sp_runtime::{40 Permill,40 Permill,41 traits::Block as BlockT,41 traits::Block as BlockT,251 OpaqueMetadata::new(Runtime::metadata().into())251 OpaqueMetadata::new(Runtime::metadata().into())252 }252 }253254 fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {255 Runtime::metadata_at_version(version)256 }257258 fn metadata_versions() -> sp_std::vec::Vec<u32> {259 Runtime::metadata_versions()260 }253 }261 }254262255 impl sp_block_builder::BlockBuilder<Block> for Runtime {263 impl sp_block_builder::BlockBuilder<Block> for Runtime {311 fn account_code_at(address: H160) -> Vec<u8> {319 fn account_code_at(address: H160) -> Vec<u8> {312 use pallet_evm::OnMethodCall;320 use pallet_evm::OnMethodCall;313 <Runtime as pallet_evm::Config>::OnMethodCall::get_code(&address)321 <Runtime as pallet_evm::Config>::OnMethodCall::get_code(&address)314 .unwrap_or_else(|| EVM::account_codes(address))322 .unwrap_or_else(|| pallet_evm::AccountCodes::<Runtime>::get(address))315 }323 }316324317 fn author() -> H160 {325 fn author() -> H160 {321 fn storage_at(address: H160, index: U256) -> H256 {329 fn storage_at(address: H160, index: U256) -> H256 {322 let mut tmp = [0u8; 32];330 let mut tmp = [0u8; 32];323 index.to_big_endian(&mut tmp);331 index.to_big_endian(&mut tmp);324 EVM::account_storages(address, H256::from_slice(&tmp[..]))332 pallet_evm::AccountStorages::<Runtime>::get(address, H256::from_slice(&tmp[..]))325 }333 }326334327 #[allow(clippy::redundant_closure)]335 #[allow(clippy::redundant_closure)]401 }409 }402410403 fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {411 fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {404 Ethereum::current_transaction_statuses()412 pallet_ethereum::CurrentTransactionStatuses::<Runtime>::get()405 }413 }406414407 fn current_block() -> Option<pallet_ethereum::Block> {415 fn current_block() -> Option<pallet_ethereum::Block> {408 Ethereum::current_block()416 pallet_ethereum::CurrentBlock::<Runtime>::get()409 }417 }410418411 fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {419 fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {412 Ethereum::current_receipts()420 pallet_ethereum::CurrentReceipts::<Runtime>::get()413 }421 }414422415 fn current_all() -> (423 fn current_all() -> (418 Option<Vec<TransactionStatus>>426 Option<Vec<TransactionStatus>>419 ) {427 ) {420 (428 (421 Ethereum::current_block(),429 pallet_ethereum::CurrentBlock::<Runtime>::get(),422 Ethereum::current_receipts(),430 pallet_ethereum::CurrentReceipts::<Runtime>::get(),423 Ethereum::current_transaction_statuses()431 pallet_ethereum::CurrentTransactionStatuses::<Runtime>::get()424 )432 )425 }433 }426434653661654 impl up_pov_estimate_rpc::PovEstimateApi<Block> for Runtime {662 impl up_pov_estimate_rpc::PovEstimateApi<Block> for Runtime {655 #[allow(unused_variables)]663 #[allow(unused_variables)]656 fn pov_estimate(uxt: Bytes) -> ApplyExtrinsicResult {664 fn pov_estimate(uxt: Vec<u8>) -> ApplyExtrinsicResult {657 #[cfg(feature = "pov-estimate")]665 #[cfg(feature = "pov-estimate")]658 {666 {659 use codec::Decode;667 use codec::Decode;660668661 let uxt_decode = <<Block as BlockT>::Extrinsic as Decode>::decode(&mut &*uxt)669 let uxt_decode = <<Block as BlockT>::Extrinsic as Decode>::decode(&mut &uxt)662 .map_err(|_| DispatchError::Other("failed to decode the extrinsic"));670 .map_err(|_| DispatchError::Other("failed to decode the extrinsic"));663671664 let uxt = match uxt_decode {672 let uxt = match uxt_decode {runtime/common/weights/xcm.rsdiffbeforeafterboth245 .saturating_add(T::DbWeight::get().writes(4_u64))245 .saturating_add(T::DbWeight::get().writes(4_u64))246 }246 }247248 fn force_suspension() -> Weight {249 Default::default()250 }247}251}248252249253runtime/opal/Cargo.tomldiffbeforeafterboth220orml-xcm-support = { workspace = true }220orml-xcm-support = { workspace = true }221pallet-aura = { workspace = true }221pallet-aura = { workspace = true }222pallet-authorship = { workspace = true }222pallet-authorship = { workspace = true }223pallet-balances = { workspace = true }223pallet-balances = { features = ["insecure_zero_ed"], workspace = true }224pallet-preimage = { workspace = true }224pallet-preimage = { workspace = true }225pallet-session = { workspace = true }225pallet-session = { workspace = true }226pallet-sudo = { workspace = true }226pallet-sudo = { workspace = true }runtime/quartz/Cargo.tomldiffbeforeafterboth212orml-xcm-support = { workspace = true }212orml-xcm-support = { workspace = true }213pallet-aura = { workspace = true }213pallet-aura = { workspace = true }214pallet-authorship = { workspace = true }214pallet-authorship = { workspace = true }215pallet-balances = { workspace = true }215pallet-balances = { features = ["insecure_zero_ed"], workspace = true }216pallet-preimage = { workspace = true }216pallet-preimage = { workspace = true }217pallet-session = { workspace = true }217pallet-session = { workspace = true }218pallet-sudo = { workspace = true }218pallet-sudo = { workspace = true }runtime/tests/Cargo.tomldiffbeforeafterboth9refungible = []9refungible = []101011[dependencies]11[dependencies]12up-data-structs = { default-features = false, path = "../../primitives/data-structs" }12up-data-structs = { workspace = true }131314sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }14sp-core = { workspace = true }15sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }15sp-io = { workspace = true }16sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }16sp-runtime = { workspace = true }17sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }17sp-std = { workspace = true }181819frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }19frame-support = { workspace = true }20frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }20frame-system = { workspace = true }212122pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }22pallet-balances = { features = ["insecure_zero_ed"], workspace = true }23pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }23pallet-timestamp = { workspace = true }24pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }24pallet-transaction-payment = { workspace = true }252526pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.42" }26pallet-ethereum = { workspace = true }27pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.42" }27pallet-evm = { workspace = true }282829pallet-common.path = "../../pallets/common"29pallet-common = { workspace = true }30pallet-fungible.path = "../../pallets/fungible"30pallet-fungible = { workspace = true }31pallet-nonfungible.path = "../../pallets/nonfungible"31pallet-nonfungible = { workspace = true }32pallet-refungible.path = "../../pallets/refungible"32pallet-refungible = { workspace = true }33pallet-structure.path = "../../pallets/structure"33pallet-structure = { workspace = true }34pallet-unique.path = "../../pallets/unique"34pallet-unique = { workspace = true }353536pallet-evm-coder-substrate.path = "../../pallets/evm-coder-substrate"36pallet-evm-coder-substrate = { workspace = true }373738parity-scale-codec = { version = "3.2.2", default-features = false, features = ["derive"] }38codec = { workspace = true }39scale-info = "*"39scale-info = { workspace = true }404041evm-coder = { workspace = true }41evm-coder = { workspace = true }42up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.42" }42up-sponsorship = { workspace = true }43xcm = { workspace = true }43xcm = { workspace = true }44pallet-xcm = { workspace = true }44pallet-xcm = { workspace = true }45pallet-configuration = { workspace = true }45pallet-configuration = { workspace = true }runtime/unique/Cargo.tomldiffbeforeafterboth211orml-xcm-support = { workspace = true }211orml-xcm-support = { workspace = true }212pallet-aura = { workspace = true }212pallet-aura = { workspace = true }213pallet-authorship = { workspace = true }213pallet-authorship = { workspace = true }214pallet-balances = { workspace = true }214pallet-balances = { features = ["insecure_zero_ed"], workspace = true }215pallet-preimage = { workspace = true }215pallet-preimage = { workspace = true }216pallet-session = { workspace = true }216pallet-session = { workspace = true }217pallet-sudo = { workspace = true }217pallet-sudo = { workspace = true }