difftreelog
fix cargo fmt
in: master
7 files changed
crates/evm-coder/src/execution.rsdiffbeforeafterboth--- a/crates/evm-coder/src/execution.rs
+++ b/crates/evm-coder/src/execution.rs
@@ -60,12 +60,16 @@
}
impl From<u64> for DispatchInfo {
fn from(weight: u64) -> Self {
- Self { weight: Weight::from_ref_time(weight) }
+ Self {
+ weight: Weight::from_ref_time(weight),
+ }
}
}
impl From<()> for DispatchInfo {
fn from(_: ()) -> Self {
- Self { weight: Weight::zero() }
+ Self {
+ weight: Weight::zero(),
+ }
}
}
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -327,7 +327,7 @@
Arc::new(RelayChainRpcInterface::new(rpc_client)) as Arc<_>,
None,
))
- },
+ }
None => build_inprocess_relay_chain(
polkadot_config,
parachain_config,
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -185,25 +185,21 @@
/// Consume gas for reading.
pub fn consume_store_reads(&self, reads: u64) -> evm_coder::execution::Result<()> {
self.recorder
- .consume_gas(T::GasWeightMapping::weight_to_gas(
- Weight::from_ref_time(
- <T as frame_system::Config>::DbWeight::get()
- .read
- .saturating_mul(reads)
- ),
- ))
+ .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_ref_time(
+ <T as frame_system::Config>::DbWeight::get()
+ .read
+ .saturating_mul(reads),
+ )))
}
/// Consume gas for writing.
pub fn consume_store_writes(&self, writes: u64) -> evm_coder::execution::Result<()> {
self.recorder
- .consume_gas(T::GasWeightMapping::weight_to_gas(
- Weight::from_ref_time(
- <T as frame_system::Config>::DbWeight::get()
- .write
- .saturating_mul(writes)
- ),
- ))
+ .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_ref_time(
+ <T as frame_system::Config>::DbWeight::get()
+ .write
+ .saturating_mul(writes),
+ )))
}
/// Consume gas for reading and writing.
@@ -216,9 +212,9 @@
let reads = weight.read.saturating_mul(reads);
let writes = weight.read.saturating_mul(writes);
self.recorder
- .consume_gas(T::GasWeightMapping::weight_to_gas(
- Weight::from_ref_time(reads.saturating_add(writes)),
- ))
+ .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_ref_time(
+ reads.saturating_add(writes),
+ )))
}
/// Save collection to storage.
pallets/refungible/src/lib.rsdiffbeforeafterboth--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -99,9 +99,7 @@
use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm};
use pallet_evm_coder_substrate::WithRecorder;
use pallet_common::{
- CommonCollectionOperations,
- Error as CommonError,
- eth::collection_id_to_address,
+ CommonCollectionOperations, Error as CommonError, eth::collection_id_to_address,
Event as CommonEvent, Pallet as PalletCommon,
};
use pallet_structure::Pallet as PalletStructure;
@@ -110,10 +108,10 @@
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};
use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};
use up_data_structs::{
- AccessMode, budget::Budget, CollectionId, CollectionFlags,
- CollectionPropertiesVec, CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping,
- MAX_ITEMS_PER_BATCH, MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission,
- PropertyPermission, PropertyScope, PropertyValue, TokenId, TrySetProperty,
+ AccessMode, budget::Budget, CollectionId, CollectionFlags, CollectionPropertiesVec,
+ CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH,
+ MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission,
+ PropertyScope, PropertyValue, TokenId, TrySetProperty,
};
use frame_support::BoundedBTreeMap;
use derivative::Derivative;
runtime/common/config/xcm/nativeassets.rsdiffbeforeafterboth--- a/runtime/common/config/xcm/nativeassets.rs
+++ b/runtime/common/config/xcm/nativeassets.rs
@@ -23,8 +23,7 @@
use xcm::latest::{
AssetId::{Concrete},
Fungibility::Fungible as XcmFungible,
- MultiAsset, Error as XcmError,
- Weight,
+ MultiAsset, Error as XcmError, Weight,
};
use xcm_builder::{CurrencyAdapter, NativeAsset};
use xcm_executor::{
runtime/common/mod.rsdiffbeforeafterboth--- a/runtime/common/mod.rs
+++ b/runtime/common/mod.rs
@@ -39,10 +39,7 @@
#[cfg(feature = "std")]
use sp_version::NativeVersion;
-use crate::{
- Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsWithSystem,
- InherentDataExt,
-};
+use crate::{Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsWithSystem, InherentDataExt};
use up_common::types::{AccountId, BlockNumber};
#[macro_export]
@@ -105,7 +102,7 @@
Block,
frame_system::ChainContext<Runtime>,
Runtime,
- AllPalletsWithSystem
+ AllPalletsWithSystem,
>;
type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;
runtime/opal/src/xcm_barrier.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use frame_support::traits::Everything;18use xcm::{latest::{Xcm, Weight}, v1::MultiLocation};19use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};20use xcm_executor::traits::ShouldExecute;2122use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact};2324/// Execution barrier that just takes `max_weight` from `weight_credit`.25///26/// Useful to allow XCM execution by local chain users via extrinsics.27/// E.g. `pallet_xcm::reserve_asset_transfer` to transfer a reserve asset28/// out of the local chain to another one.29pub struct AllowAllDebug;30impl ShouldExecute for AllowAllDebug {31 fn should_execute<Call>(32 _origin: &MultiLocation,33 _message: &mut Xcm<Call>,34 _max_weight: Weight,35 _weight_credit: &mut Weight,36 ) -> Result<(), ()> {37 Ok(())38 }39}4041pub type Barrier = DenyThenTry<42 DenyTransact,43 (44 TakeWeightCredit,45 AllowTopLevelPaidExecutionFrom<Everything>,46 AllowAllDebug,47 ),48>;1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use frame_support::traits::Everything;18use xcm::{19 latest::{Xcm, Weight},20 v1::MultiLocation,21};22use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};23use xcm_executor::traits::ShouldExecute;2425use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact};2627/// Execution barrier that just takes `max_weight` from `weight_credit`.28///29/// Useful to allow XCM execution by local chain users via extrinsics.30/// E.g. `pallet_xcm::reserve_asset_transfer` to transfer a reserve asset31/// out of the local chain to another one.32pub struct AllowAllDebug;33impl ShouldExecute for AllowAllDebug {34 fn should_execute<Call>(35 _origin: &MultiLocation,36 _message: &mut Xcm<Call>,37 _max_weight: Weight,38 _weight_credit: &mut Weight,39 ) -> Result<(), ()> {40 Ok(())41 }42}4344pub type Barrier = DenyThenTry<45 DenyTransact,46 (47 TakeWeightCredit,48 AllowTopLevelPaidExecutionFrom<Everything>,49 AllowAllDebug,50 ),51>;