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 -18
View File
@@ -84,12 +84,7 @@ const B: u64 = 2;
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
let genesis = pallet_balances::GenesisConfig::<Test> {
balances: vec![
(A, 100),
(B, 200),
],
};
let genesis = pallet_balances::GenesisConfig::<Test> { balances: vec![(A, 100), (B, 200)] };
genesis.assimilate_storage(&mut t).unwrap();
t.into()
}
@@ -112,7 +107,8 @@ fn two_party_successful_swap() {
hashed_proof.clone(),
BalanceSwapAction::new(50),
1000,
).unwrap();
)
.unwrap();
assert_eq!(Balances::free_balance(A), 100 - 50);
assert_eq!(Balances::free_balance(B), 200);
@@ -126,7 +122,8 @@ fn two_party_successful_swap() {
hashed_proof.clone(),
BalanceSwapAction::new(75),
1000,
).unwrap();
)
.unwrap();
assert_eq!(Balances::free_balance(A), 100);
assert_eq!(Balances::free_balance(B), 200 - 75);
@@ -134,11 +131,8 @@ fn two_party_successful_swap() {
// A reveals the proof and claims the swap on chain2.
chain2.execute_with(|| {
AtomicSwap::claim_swap(
Origin::signed(A),
proof.to_vec(),
BalanceSwapAction::new(75),
).unwrap();
AtomicSwap::claim_swap(Origin::signed(A), proof.to_vec(), BalanceSwapAction::new(75))
.unwrap();
assert_eq!(Balances::free_balance(A), 100 + 75);
assert_eq!(Balances::free_balance(B), 200 - 75);
@@ -146,11 +140,8 @@ fn two_party_successful_swap() {
// B use the revealed proof to claim the swap on chain1.
chain1.execute_with(|| {
AtomicSwap::claim_swap(
Origin::signed(B),
proof.to_vec(),
BalanceSwapAction::new(50),
).unwrap();
AtomicSwap::claim_swap(Origin::signed(B), proof.to_vec(), BalanceSwapAction::new(50))
.unwrap();
assert_eq!(Balances::free_balance(A), 100 - 50);
assert_eq!(Balances::free_balance(B), 200 + 50);