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
+6 -17
View File
@@ -18,13 +18,12 @@
//! Tests for the module.
use super::*;
use mock::{
Lottery, Balances, Test, Origin, Call, SystemCall, BalancesCall,
new_test_ext, run_to_block
};
use sp_runtime::traits::{BadOrigin};
use frame_support::{assert_noop, assert_ok};
use mock::{
new_test_ext, run_to_block, Balances, BalancesCall, Call, Lottery, Origin, SystemCall, Test,
};
use pallet_balances::Error as BalancesError;
use sp_runtime::traits::BadOrigin;
#[test]
fn initial_state() {
@@ -86,13 +85,7 @@ fn basic_end_to_end_works() {
assert_eq!(LotteryIndex::<Test>::get(), 2);
assert_eq!(
crate::Lottery::<Test>::get().unwrap(),
LotteryConfig {
price,
start: 25,
length,
delay,
repeat: true,
}
LotteryConfig { price, start: 25, length, delay, repeat: true }
);
});
}
@@ -184,10 +177,7 @@ fn buy_ticket_works_as_simple_passthrough() {
);
let bad_origin_call = Box::new(Call::Balances(BalancesCall::force_transfer(0, 0, 0)));
assert_noop!(
Lottery::buy_ticket(Origin::signed(1), bad_origin_call),
BadOrigin,
);
assert_noop!(Lottery::buy_ticket(Origin::signed(1), bad_origin_call), BadOrigin,);
// User can call other txs, but doesn't get a ticket
let remark_call = Box::new(Call::System(SystemCall::remark(b"hello, world!".to_vec())));
@@ -210,7 +200,6 @@ fn buy_ticket_works() {
];
assert_ok!(Lottery::set_calls(Origin::root(), calls));
// Can't buy ticket before start
let call = Box::new(Call::Balances(BalancesCall::transfer(2, 1)));
assert_ok!(Lottery::buy_ticket(Origin::signed(1), call.clone()));