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:
Bastian Köcher
2021-07-21 16:32:32 +02:00
committed by GitHub
parent d451c38c1c
commit 7b56ab15b4
1010 changed files with 53339 additions and 51208 deletions
+9 -5
View File
@@ -20,14 +20,16 @@
use crate::*;
use frame_support::{
assert_ok, parameter_types,
weights::{DispatchInfo, GetDispatchInfo}, traits::OnInitialize
traits::OnInitialize,
weights::{DispatchInfo, GetDispatchInfo},
};
use sp_core::H256;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sp_runtime::{
testing::Header, BuildStorage,
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
BuildStorage,
};
// Reexport crate as its pallet name for construct_runtime.
use crate as pallet_example;
@@ -115,7 +117,9 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
bar: vec![(1, 2), (2, 3)],
foo: 24,
},
}.build_storage().unwrap();
}
.build_storage()
.unwrap();
t.into()
}
@@ -163,7 +167,8 @@ fn signed_ext_watch_dummy_works() {
let info = DispatchInfo::default();
assert_eq!(
WatchDummy::<Test>(PhantomData).validate(&1, &call, &info, 150)
WatchDummy::<Test>(PhantomData)
.validate(&1, &call, &info, 150)
.unwrap()
.priority,
u64::MAX,
@@ -183,7 +188,6 @@ fn weights_work() {
// aka. `let info = <Call<Test> as GetDispatchInfo>::get_dispatch_info(&default_call);`
assert!(info1.weight > 0);
// `set_dummy` is simpler than `accumulate_dummy`, and the weight
// should be less.
let custom_call = <pallet_example::Call<Test>>::set_dummy(20);