mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +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:
@@ -18,20 +18,25 @@
|
||||
//! Test utilities
|
||||
|
||||
use super::*;
|
||||
use frame_support::{parameter_types, traits::GenesisBuild};
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use sp_io;
|
||||
use crate as sudo;
|
||||
use frame_support::traits::Filter;
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{Filter, GenesisBuild},
|
||||
};
|
||||
use frame_system::limits;
|
||||
use sp_core::H256;
|
||||
use sp_io;
|
||||
use sp_runtime::{
|
||||
testing::Header,
|
||||
traits::{BlakeTwo256, IdentityLookup},
|
||||
};
|
||||
|
||||
// Logger module to track execution.
|
||||
#[frame_support::pallet]
|
||||
pub mod logger {
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {
|
||||
@@ -48,7 +53,7 @@ pub mod logger {
|
||||
pub fn privileged_i32_log(
|
||||
origin: OriginFor<T>,
|
||||
i: i32,
|
||||
weight: Weight
|
||||
weight: Weight,
|
||||
) -> DispatchResultWithPostInfo {
|
||||
// Ensure that the `origin` is `Root`.
|
||||
ensure_root(origin)?;
|
||||
@@ -61,7 +66,7 @@ pub mod logger {
|
||||
pub fn non_privileged_log(
|
||||
origin: OriginFor<T>,
|
||||
i: i32,
|
||||
weight: Weight
|
||||
weight: Weight,
|
||||
) -> DispatchResultWithPostInfo {
|
||||
// Ensure that the `origin` is some signed account.
|
||||
let sender = ensure_signed(origin)?;
|
||||
@@ -82,22 +87,13 @@ pub mod logger {
|
||||
|
||||
#[pallet::storage]
|
||||
#[pallet::getter(fn account_log)]
|
||||
pub(super) type AccountLog<T: Config> = StorageValue<
|
||||
_,
|
||||
Vec<T::AccountId>,
|
||||
ValueQuery
|
||||
>;
|
||||
pub(super) type AccountLog<T: Config> = StorageValue<_, Vec<T::AccountId>, ValueQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pallet::getter(fn i32_log)]
|
||||
pub(super) type I32Log<T> = StorageValue<
|
||||
_,
|
||||
Vec<i32>,
|
||||
ValueQuery
|
||||
>;
|
||||
pub(super) type I32Log<T> = StorageValue<_, Vec<i32>, ValueQuery>;
|
||||
}
|
||||
|
||||
|
||||
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
|
||||
type Block = frame_system::mocking::MockBlock<Test>;
|
||||
|
||||
@@ -169,8 +165,8 @@ pub type LoggerCall = logger::Call<Test>;
|
||||
// Build test environment by setting the root `key` for the Genesis.
|
||||
pub fn new_test_ext(root_key: u64) -> sp_io::TestExternalities {
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
sudo::GenesisConfig::<Test>{
|
||||
key: root_key,
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
sudo::GenesisConfig::<Test> { key: root_key }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
t.into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user