Skip to content

Commit

Permalink
fmt + CI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
olegnn committed Sep 1, 2023
1 parent 37e6270 commit d257915
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
override: true
components: rustfmt
- name: Ensure Standard Formatting
run: cargo +nightly-2023-03-09 fmt -- --check --all
run: cargo +nightly-2023-03-09 fmt --all -- --check

clippy:
runs-on: ubuntu-latest
Expand All @@ -29,6 +29,6 @@ jobs:
with:
toolchain: nightly-2023-03-09
override: true
components: rustfmt
components: clippy
- name: Ensure `clippy` is happy
run: cargo +nightly-2023-03-09 clippy -- --all --all-targets
run: cargo +nightly-2023-03-09 clippy --all
2 changes: 1 addition & 1 deletion pallets/core/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ pub use policy::*;
pub use signatures::*;
pub use state_change::*;
pub use storage_version::*;
pub use types::*;
pub use types::*;
5 changes: 2 additions & 3 deletions pallets/core/src/modules/accumulator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
use crate::{
common::{SigValue, StorageVersion, CurveType},
common::{CurveType, SigValue, StorageVersion},
did,
did::{Did, DidSignature},
util::{Bytes, IncId},
};
pub use actions::*;
use arith_utils::DivCeil;
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use frame_support::{
decl_error, decl_event, decl_module, decl_storage,
dispatch::{DispatchResult, Weight},
ensure,
traits::Get,
};
use frame_system::{self as system, ensure_signed};
use sp_std::prelude::*;
use sp_std::{fmt::Debug, prelude::*};
pub use types::*;
use weights::*;

Expand Down
3 changes: 1 addition & 2 deletions pallets/core/src/modules/attest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ use crate::{
did::{self, Did, DidSignature},
};
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use frame_support::{
decl_error, decl_module, decl_storage, dispatch::DispatchResult, ensure, traits::Get,
weights::Weight,
};
use frame_system::{self as system, ensure_signed};
use sp_std::prelude::*;
use sp_std::{fmt::Debug, prelude::*};
use weights::*;

#[cfg(feature = "runtime-benchmarks")]
Expand Down
6 changes: 4 additions & 2 deletions pallets/core/src/modules/did/base/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::impl_wrapper;
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use sp_std::ops::{Index, RangeFull};
use sp_std::{
fmt::Debug,
ops::{Index, RangeFull},
};

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion pallets/core/src/modules/did/benchmarks.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use super::*;
use crate::common::state_change::ToStateChange;
use alloc::collections::BTreeSet;
use sp_std::iter::once;
use frame_benchmarking::{benchmarks, whitelisted_caller};
use sp_application_crypto::Pair;
use sp_core::{ed25519, U256};
use sp_std::iter::once;
#[cfg(not(feature = "std"))]
use sp_std::prelude::*;
use system::RawOrigin;
Expand Down
2 changes: 1 addition & 1 deletion pallets/core/src/modules/did/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::{

use arith_utils::DivCeil;
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use frame_support::{
decl_error, decl_event, decl_module, decl_storage, dispatch::DispatchResult, ensure, fail,
traits::Get, weights::Weight,
Expand All @@ -16,6 +15,7 @@ use sp_runtime::DispatchError;
use sp_std::{
collections::btree_set::BTreeSet,
convert::{TryFrom, TryInto},
fmt::Debug,
prelude::*,
vec::Vec,
};
Expand Down
4 changes: 2 additions & 2 deletions pallets/core/src/modules/offchain_signatures/migration.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
did::*,
common::CurveType,
did::*,
offchain_signatures::{
self, Config, OffchainPublicKey, OffchainSignatureParams, PublicKeys, SignatureParams,
SignatureParamsOwner, SignatureParamsStorageKey,
Expand All @@ -9,12 +9,12 @@ use crate::{
};
use alloc::vec;
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use frame_support::{
traits::{Get, GetStorageVersion, PalletInfoAccess},
weights::Weight,
*,
};
use sp_std::fmt::Debug;

/// DID owner of the BBSPlus parameters.
#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, Copy, Ord, PartialOrd)]
Expand Down
3 changes: 1 addition & 2 deletions pallets/core/src/modules/offchain_signatures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use crate::{
util::IncId,
};
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use sp_std::prelude::*;
use sp_std::{fmt::Debug, prelude::*};

use frame_support::{
decl_error, decl_event, decl_module, decl_storage,
Expand Down
2 changes: 1 addition & 1 deletion pallets/core/src/modules/offchain_signatures/params.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{did::Did, offchain_signatures::schemes::*, util::IncId};
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use frame_support::{ensure, traits::Get, IterableStorageDoubleMap, StorageDoubleMap, StorageMap};
use sp_runtime::DispatchResult;
use sp_std::fmt::Debug;

use super::{
AddOffchainSignatureParams, BBSPlusPublicKey, Config, Error, Event, Module, PSPublicKey,
Expand Down
2 changes: 1 addition & 1 deletion pallets/core/src/modules/offchain_signatures/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use crate::{
util::IncId,
};
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use frame_support::{ensure, traits::Get, IterableStorageDoubleMap, StorageDoubleMap};
use sp_runtime::DispatchResult;
use sp_std::fmt::Debug;

use super::{
AddOffchainSignaturePublicKey, Config, Error, Event, Module, OffchainSignatureParams,
Expand Down
4 changes: 2 additions & 2 deletions pallets/core/src/modules/offchain_signatures/schemes.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{offchain_signatures::SignatureParams, common::CurveType, util::Bytes};
use crate::{common::CurveType, offchain_signatures::SignatureParams, util::Bytes};
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use frame_support::StorageDoubleMap;
use sp_runtime::traits::CheckedConversion;
use sp_std::fmt::Debug;

use super::{OffchainSignatureParams, SignatureParamsStorageKey};
use crate::offchain_signatures::OffchainPublicKey;
Expand Down
2 changes: 1 addition & 1 deletion pallets/core/src/modules/offchain_signatures/tests.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use super::*;
use crate::{
common::CurveType,
did::{tests::check_did_detail, AddControllers},
offchain_signatures,
tests::common::*,
common::CurveType,
util::Bytes,
};
use alloc::collections::BTreeMap;
Expand Down
3 changes: 1 addition & 2 deletions pallets/core/src/modules/revoke/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use crate::{
};
use alloc::collections::BTreeSet;
use codec::{Decode, Encode};
use sp_std::{fmt::Debug, marker::PhantomData};
use sp_std::vec::Vec;
use sp_std::{fmt::Debug, marker::PhantomData, vec::Vec};

pub use actions::*;
use frame_support::{
Expand Down
2 changes: 1 addition & 1 deletion pallets/core/src/modules/revoke/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use crate::{
util::{Action, WithNonce},
};
use alloc::collections::BTreeMap;
use sp_std::{iter::once, marker::PhantomData};
use frame_support::assert_noop;
use sp_core::{sr25519, U256};
use sp_std::{iter::once, marker::PhantomData};

pub fn get_pauth<A: Action<Test> + Clone>(
action: &A,
Expand Down
3 changes: 1 addition & 2 deletions pallets/core/src/modules/status_list_credential/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ use crate::{
util::{Action, NonceError, WithNonce},
};
use alloc::vec::*;
use sp_std::fmt::Debug;
use frame_support::{decl_error, decl_event, decl_module, decl_storage, pallet_prelude::*};
use frame_system as system;
use frame_system::ensure_signed;
use sp_std::prelude::*;
use sp_std::{fmt::Debug, prelude::*};

#[cfg(feature = "runtime-benchmarks")]
pub mod benchmarks;
Expand Down
2 changes: 1 addition & 1 deletion pallets/core/src/modules/status_list_credential/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use crate::{
util::{Action, WithNonce},
};
use alloc::collections::BTreeMap;
use sp_std::{iter::empty, marker::PhantomData};
use frame_support::{assert_noop, assert_ok};
use sp_core::sr25519;
use sp_runtime::DispatchError;
use sp_std::{iter::empty, marker::PhantomData};

type Mod = super::Pallet<Test>;

Expand Down
2 changes: 1 addition & 1 deletion pallets/core/src/util/hex.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use sp_std::{fmt, marker::PhantomData};
use serde::{
self,
de::{Error, Visitor},
};
use serde_hex::FromHex;
use sp_std::{fmt, marker::PhantomData};

struct HexStrVisitor<T>(PhantomData<T>);

Expand Down
3 changes: 1 addition & 2 deletions pallets/core/src/util/with_nonce.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use codec::{Decode, Encode};
use sp_std::fmt::Debug;
use sp_runtime::{traits::CheckedAdd, DispatchError};
use sp_std::convert::TryInto;
use sp_std::{convert::TryInto, fmt::Debug};

/// Wrapper for any kind of entity with a nonce.
/// Nonces are mostly used for replay protection.
Expand Down

0 comments on commit d257915

Please sign in to comment.