mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 15:11:03 +00:00
Run cargo fmt on the whole code base (#9394)
* Run cargo fmt on the whole code base * Second run * Add CI check * Fix compilation * More unnecessary braces * Handle weights * Use --all * Use correct attributes... * Fix UI tests * AHHHHHHHHH * 🤦 * Docs * Fix compilation * 🤷 * Please stop * 🤦 x 2 * More * make rustfmt.toml consistent with polkadot Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
@@ -21,11 +21,11 @@
|
||||
|
||||
use super::*;
|
||||
|
||||
use frame_system::RawOrigin;
|
||||
use frame_benchmarking::{benchmarks, account, whitelisted_caller, impl_benchmark_test_suite};
|
||||
use sp_runtime::traits::Bounded;
|
||||
use frame_support::{ensure, traits::Get};
|
||||
use crate::Pallet as Identity;
|
||||
use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite, whitelisted_caller};
|
||||
use frame_support::{ensure, traits::Get};
|
||||
use frame_system::RawOrigin;
|
||||
use sp_runtime::traits::Bounded;
|
||||
|
||||
const SEED: u32 = 0;
|
||||
|
||||
@@ -39,11 +39,19 @@ fn add_registrars<T: Config>(r: u32) -> Result<(), &'static str> {
|
||||
let registrar: T::AccountId = account("registrar", i, SEED);
|
||||
let _ = T::Currency::make_free_balance_be(®istrar, BalanceOf::<T>::max_value());
|
||||
Identity::<T>::add_registrar(RawOrigin::Root.into(), registrar.clone())?;
|
||||
Identity::<T>::set_fee(RawOrigin::Signed(registrar.clone()).into(), i.into(), 10u32.into())?;
|
||||
let fields = IdentityFields(
|
||||
IdentityField::Display | IdentityField::Legal | IdentityField::Web | IdentityField::Riot
|
||||
| IdentityField::Email | IdentityField::PgpFingerprint | IdentityField::Image | IdentityField::Twitter
|
||||
);
|
||||
Identity::<T>::set_fee(
|
||||
RawOrigin::Signed(registrar.clone()).into(),
|
||||
i.into(),
|
||||
10u32.into(),
|
||||
)?;
|
||||
let fields =
|
||||
IdentityFields(
|
||||
IdentityField::Display |
|
||||
IdentityField::Legal | IdentityField::Web |
|
||||
IdentityField::Riot | IdentityField::Email |
|
||||
IdentityField::PgpFingerprint |
|
||||
IdentityField::Image | IdentityField::Twitter,
|
||||
);
|
||||
Identity::<T>::set_fields(RawOrigin::Signed(registrar.clone()).into(), i.into(), fields)?;
|
||||
}
|
||||
|
||||
@@ -53,7 +61,10 @@ fn add_registrars<T: Config>(r: u32) -> Result<(), &'static str> {
|
||||
|
||||
// Create `s` sub-accounts for the identity of `who` and return them.
|
||||
// Each will have 32 bytes of raw data added to it.
|
||||
fn create_sub_accounts<T: Config>(who: &T::AccountId, s: u32) -> Result<Vec<(T::AccountId, Data)>, &'static str> {
|
||||
fn create_sub_accounts<T: Config>(
|
||||
who: &T::AccountId,
|
||||
s: u32,
|
||||
) -> Result<Vec<(T::AccountId, Data)>, &'static str> {
|
||||
let mut subs = Vec::new();
|
||||
let who_origin = RawOrigin::Signed(who.clone());
|
||||
let data = Data::Raw(vec![0; 32].try_into().unwrap());
|
||||
@@ -73,7 +84,10 @@ fn create_sub_accounts<T: Config>(who: &T::AccountId, s: u32) -> Result<Vec<(T::
|
||||
|
||||
// Adds `s` sub-accounts to the identity of `who`. Each will have 32 bytes of raw data added to it.
|
||||
// This additionally returns the vector of sub-accounts so it can be modified if needed.
|
||||
fn add_sub_accounts<T: Config>(who: &T::AccountId, s: u32) -> Result<Vec<(T::AccountId, Data)>, &'static str> {
|
||||
fn add_sub_accounts<T: Config>(
|
||||
who: &T::AccountId,
|
||||
s: u32,
|
||||
) -> Result<Vec<(T::AccountId, Data)>, &'static str> {
|
||||
let who_origin = RawOrigin::Signed(who.clone());
|
||||
let subs = create_sub_accounts::<T>(who, s)?;
|
||||
|
||||
@@ -399,8 +413,4 @@ benchmarks! {
|
||||
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(
|
||||
Identity,
|
||||
crate::tests::new_test_ext(),
|
||||
crate::tests::Test,
|
||||
);
|
||||
impl_benchmark_test_suite!(Identity, crate::tests::new_test_ext(), crate::tests::Test,);
|
||||
|
||||
Reference in New Issue
Block a user