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
@@ -15,13 +15,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use codec::{Encode, Decode};
use crate::{Config, Pallet, BlockHash};
use crate::{BlockHash, Config, Pallet};
use codec::{Decode, Encode};
use sp_runtime::{
generic::Era,
traits::{SignedExtension, DispatchInfoOf, SaturatedConversion},
traits::{DispatchInfoOf, SaturatedConversion, SignedExtension},
transaction_validity::{
ValidTransaction, TransactionValidityError, InvalidTransaction, TransactionValidity,
InvalidTransaction, TransactionValidity, TransactionValidityError, ValidTransaction,
},
};
@@ -84,7 +84,7 @@ impl<T: Config + Send + Sync> SignedExtension for CheckMortality<T> {
#[cfg(test)]
mod tests {
use super::*;
use crate::mock::{Test, new_test_ext, System, CALL};
use crate::mock::{new_test_ext, System, Test, CALL};
use frame_support::weights::{DispatchClass, DispatchInfo, Pays};
use sp_core::H256;
@@ -93,7 +93,10 @@ mod tests {
new_test_ext().execute_with(|| {
// future
assert_eq!(
CheckMortality::<Test>::from(Era::mortal(4, 2)).additional_signed().err().unwrap(),
CheckMortality::<Test>::from(Era::mortal(4, 2))
.additional_signed()
.err()
.unwrap(),
InvalidTransaction::AncientBirthBlock.into(),
);
@@ -107,7 +110,8 @@ mod tests {
#[test]
fn signed_ext_check_era_should_change_longevity() {
new_test_ext().execute_with(|| {
let normal = DispatchInfo { weight: 100, class: DispatchClass::Normal, pays_fee: Pays::Yes };
let normal =
DispatchInfo { weight: 100, class: DispatchClass::Normal, pays_fee: Pays::Yes };
let len = 0_usize;
let ext = (
crate::CheckWeight::<Test>::new(),