Skip to content

Commit cd98e2b

Browse files
committed
Fix clippy and formatting
1 parent f3c8a44 commit cd98e2b

5 files changed

Lines changed: 11 additions & 2 deletions

File tree

core/src/commands/on_runtime_upgrade/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ where
175175
/// Check that the migrations are idempotent.
176176
///
177177
/// Expects the overlayed changes from the first execution of the migrations.
178+
#[allow(clippy::result_large_err)]
178179
fn check_idempotency(
179180
&self,
180181
ext: &mut RemoteExternalities<Block>,
@@ -252,6 +253,7 @@ where
252253
}
253254

254255
/// Check that the migrations don't use more weights than a block.
256+
#[allow(clippy::result_large_err)]
255257
fn check_weight(&self, ext: &RemoteExternalities<Block>) -> sc_cli::Result<bool> {
256258
if self.command.no_weight_warnings {
257259
log::info!("ℹ Skipping weight safety check");
@@ -300,6 +302,7 @@ where
300302
}
301303

302304
/// Whether any storage was changed.
305+
#[allow(clippy::result_large_err)]
303306
fn changed(
304307
&self,
305308
ext: &RemoteExternalities<Block>,

core/src/common/empty_block/inherents/custom_idps/para_parachain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ impl<B: BlockT> sp_inherents::InherentDataProvider for InherentDataProvider<B> {
120120
];
121121

122122
// Check if `PendingValidationCode` exists in storage before setting `GoAhead`.
123-
// The parachain-system pallet panics if `GoAhead` is provided without a pending validation code.
124-
// See: https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/pallets/parachain-system/src/lib.rs#L667
123+
// The parachain-system pallet panics if `GoAhead` is provided without a pending validation
124+
// code. See: https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/pallets/parachain-system/src/lib.rs#L667
125125
let has_pending = has_pending_validation_code::<B>(ext);
126126
let upgrade_go_ahead = if has_pending {
127127
Some(UpgradeGoAhead::GoAhead)

core/src/common/empty_block/production.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,15 @@ async fn call<T: Decode, Block: BlockT, HostFns: HostFunctions>(
217217
T::decode(&mut &*result).map_err(|e| sc_cli::Error::Input(format!("{:?}", e)))
218218
}
219219

220+
#[allow(clippy::result_large_err)]
220221
pub fn core_version<Block: BlockT, HostFns: HostFunctions>(
221222
externalities: &TestExternalities<HashingFor<Block>>,
222223
executor: &WasmExecutor<HostFns>,
223224
) -> Result<u32> {
224225
dry_call::<u32, Block, HostFns>(externalities, executor, "Core_version", &[])
225226
}
226227

228+
#[allow(clippy::result_large_err)]
227229
/// Call `method` with `data` and return the result. `externalities` will not change.
228230
fn dry_call<T: Decode, Block: BlockT, HostFns: HostFunctions>(
229231
externalities: &TestExternalities<HashingFor<Block>>,

core/src/common/state.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ pub struct LiveState {
8989

9090
impl LiveState {
9191
/// Return the `at` block hash as a `Hash`, if it exists.
92+
#[allow(clippy::result_large_err)]
9293
pub fn at<Block: BlockT>(&self) -> sc_cli::Result<Option<<Block>::Hash>>
9394
where
9495
<Block::Hash as FromStr>::Err: Debug,
@@ -365,6 +366,7 @@ fn ensure_try_runtime<Block: BlockT, HostFns: HostFunctions>(
365366

366367
/// Execute the given `method` and `data` on top of `ext`, returning the results (encoded) and the
367368
/// state `changes`.
369+
#[allow(clippy::result_large_err)]
368370
pub(crate) fn state_machine_call<Block: BlockT, HostFns: HostFunctions>(
369371
ext: &TestExternalities<HashingFor<Block>>,
370372
executor: &WasmExecutor<HostFns>,
@@ -394,6 +396,7 @@ pub(crate) fn state_machine_call<Block: BlockT, HostFns: HostFunctions>(
394396
/// information.
395397
///
396398
/// Make sure [`LOG_TARGET`] is enabled in logging.
399+
#[allow(clippy::result_large_err)]
397400
pub(crate) fn state_machine_call_with_proof<Block: BlockT, HostFns: HostFunctions>(
398401
ext: &TestExternalities<HashingFor<Block>>,
399402
storage_overlay: &mut OverlayedChanges<HashingFor<Block>>,

core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub mod common;
3838
pub(crate) const LOG_TARGET: &str = "try-runtime::cli";
3939

4040
/// Get the hash type of the generic `Block` from a `hash_str`.
41+
#[allow(clippy::result_large_err)]
4142
pub(crate) fn hash_of<Block: BlockT>(hash_str: &str) -> sc_cli::Result<Block::Hash>
4243
where
4344
<Block::Hash as FromStr>::Err: Debug,

0 commit comments

Comments
 (0)