Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;

/// 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)
TPublic::Pair::from_string(&format!("//{seed}"), None)
.expect("static values are valid; qed")
.public()
}
Expand Down
17 changes: 8 additions & 9 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pub fn run() -> Result<()> {
&polkadot_cli,
config.tokio_handle.clone(),
)
.map_err(|err| format!("Relay chain argument error: {}", err))?;
.map_err(|err| format!("Relay chain argument error: {err}"))?;

cmd.run(config, polkadot_config)
})
Expand Down Expand Up @@ -208,12 +208,11 @@ pub fn run() -> Result<()> {
}),
#[cfg(not(feature = "runtime-benchmarks"))]
BenchmarkCmd::Storage(_) =>
return Err(sc_cli::Error::Input(
Err(sc_cli::Error::Input(
"Compile with --features=runtime-benchmarks \
to enable storage benchmarks."
.into(),
)
.into()),
)),
#[cfg(feature = "runtime-benchmarks")]
BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| {
let partials = new_partial(&config)?;
Expand Down Expand Up @@ -271,14 +270,14 @@ pub fn run() -> Result<()> {

let hwbench = (!cli.no_hardware_benchmarks).then_some(
config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(&database_path);
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
})
).flatten();

let para_id = chain_spec::Extensions::try_get(&*config.chain_spec)
.map(|e| e.para_id)
.ok_or_else(|| "Could not find parachain ID in chain-spec.")?;
.ok_or("Could not find parachain ID in chain-spec.")?;

let polkadot_cli = RelayChainCli::new(
&config,
Expand All @@ -294,13 +293,13 @@ pub fn run() -> Result<()> {

let state_version = Cli::native_runtime_version(&config.chain_spec).state_version();
let block: Block = generate_genesis_block(&*config.chain_spec, state_version)
.map_err(|e| format!("{:?}", e))?;
.map_err(|e| format!("{e:?}"))?;
let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));

let tokio_handle = config.tokio_handle.clone();
let polkadot_config =
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, tokio_handle)
.map_err(|err| format!("Relay chain argument error: {}", err))?;
.map_err(|err| format!("Relay chain argument error: {err}"))?;

info!("Parachain id: {:?}", id);
info!("Parachain Account: {}", parachain_account);
Expand All @@ -314,7 +313,7 @@ pub fn run() -> Result<()> {
}
);

if collator_options.relay_chain_rpc_urls.is_empty() && cli.relay_chain_args.len() > 0 {
if collator_options.relay_chain_rpc_urls.is_empty() && !cli.relay_chain_args.is_empty() {
warn!("Detected relay chain node arguments together with --relay-chain-rpc-url.
This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options."
);
Expand Down
10 changes: 5 additions & 5 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ where
module.merge(
Eth::<_, _, _, fp_rpc::NoTransactionConverter, _, _, _>::new(
client.clone(),
pool.clone(),
pool,
graph,
no_tx_converter,
sync.clone(),
sync,
signers,
overrides.clone(),
overrides,
backend.clone(),
is_authority,
block_data_cache.clone(),
Expand All @@ -136,8 +136,8 @@ where

module.merge(
Net::new(
client.clone(),
network.clone(),
client,
network,
// Whether to format the `peer_count` response as Hex (default) or not.
true,
)
Expand Down
7 changes: 2 additions & 5 deletions pallets/evm-accounts/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,10 @@ construct_runtime!(
}
);

#[derive(Default)]
pub struct ExtBuilder();

impl Default for ExtBuilder {
fn default() -> Self {
Self()
}
}


impl ExtBuilder {
pub fn build(self) -> sp_io::TestExternalities {
Expand Down
4 changes: 2 additions & 2 deletions pallets/evm-utility/macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ pub fn generate_function_selector(_: TokenStream, input: TokenStream) -> TokenSt
attrs: Default::default(),
}));
} else {
panic!("Not method string: `{:?}`", lit);
panic!("Not method string: `{lit:?}`");
}
} else {
panic!("Not enum: `{:?}`", variant);
panic!("Not enum: `{variant:?}`");
}
}

Expand Down
12 changes: 6 additions & 6 deletions pallets/xc-asset-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ pub mod pallet {

// Ensure such an assetId does not exist
ensure!(
!AssetIdToLocation::<T>::contains_key(&asset_id),
!AssetIdToLocation::<T>::contains_key(asset_id),
Error::<T>::AssetAlreadyRegistered
);

let v3_asset_loc = MultiLocation::try_from(*asset_location)
.map_err(|_| Error::<T>::MultiLocationNotSupported)?;
let asset_location = VersionedMultiLocation::V3(v3_asset_loc);

AssetIdToLocation::<T>::insert(&asset_id, asset_location.clone());
AssetIdToLocation::<T>::insert(asset_id, asset_location.clone());
AssetLocationToId::<T>::insert(&asset_location, asset_id);

T::XcAssetChanged::xc_asset_registered(asset_id);
Expand Down Expand Up @@ -278,10 +278,10 @@ pub mod pallet {
let new_asset_location = VersionedMultiLocation::V3(v3_asset_loc);

let previous_asset_location =
AssetIdToLocation::<T>::get(&asset_id).ok_or(Error::<T>::AssetDoesNotExist)?;
AssetIdToLocation::<T>::get(asset_id).ok_or(Error::<T>::AssetDoesNotExist)?;

// Insert new asset type info
AssetIdToLocation::<T>::insert(&asset_id, new_asset_location.clone());
AssetIdToLocation::<T>::insert(asset_id, new_asset_location.clone());
AssetLocationToId::<T>::insert(&new_asset_location, asset_id);

// Remove previous asset type info
Expand Down Expand Up @@ -331,9 +331,9 @@ pub mod pallet {
T::ManagerOrigin::ensure_origin(origin)?;

let asset_location =
AssetIdToLocation::<T>::get(&asset_id).ok_or(Error::<T>::AssetDoesNotExist)?;
AssetIdToLocation::<T>::get(asset_id).ok_or(Error::<T>::AssetDoesNotExist)?;

AssetIdToLocation::<T>::remove(&asset_id);
AssetIdToLocation::<T>::remove(asset_id);
AssetLocationToId::<T>::remove(&asset_location);
AssetLocationUnitsPerSecond::<T>::remove(&asset_location);
T::XcAssetChanged::xc_asset_unregistered(asset_id);
Expand Down
Loading