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
+25 -46
View File
@@ -19,14 +19,13 @@
//! Genesis Configuration.
use crate::keyring::*;
use sp_keyring::{Ed25519Keyring, Sr25519Keyring};
use node_runtime::{
GenesisConfig, BalancesConfig, SessionConfig, StakingConfig, SystemConfig,
GrandpaConfig, IndicesConfig, SocietyConfig, wasm_binary_unwrap,
AccountId, StakerStatus, BabeConfig, BABE_GENESIS_EPOCH_CONFIG,
constants::currency::*, wasm_binary_unwrap, AccountId, BabeConfig, BalancesConfig,
GenesisConfig, GrandpaConfig, IndicesConfig, SessionConfig, SocietyConfig, StakerStatus,
StakingConfig, SystemConfig, BABE_GENESIS_EPOCH_CONFIG,
};
use node_runtime::constants::currency::*;
use sp_core::ChangesTrieConfiguration;
use sp_keyring::{Ed25519Keyring, Sr25519Keyring};
use sp_runtime::Perbill;
/// Create genesis runtime configuration for tests.
@@ -41,7 +40,6 @@ pub fn config_endowed(
code: Option<&[u8]>,
extra_endowed: Vec<AccountId>,
) -> GenesisConfig {
let mut endowed = vec![
(alice(), 111 * DOLLARS),
(bob(), 100 * DOLLARS),
@@ -51,59 +49,44 @@ pub fn config_endowed(
(ferdie(), 100 * DOLLARS),
];
endowed.extend(
extra_endowed.into_iter().map(|endowed| (endowed, 100*DOLLARS))
);
endowed.extend(extra_endowed.into_iter().map(|endowed| (endowed, 100 * DOLLARS)));
GenesisConfig {
system: SystemConfig {
changes_trie_config: if support_changes_trie { Some(ChangesTrieConfiguration {
digest_interval: 2,
digest_levels: 2,
}) } else { None },
changes_trie_config: if support_changes_trie {
Some(ChangesTrieConfiguration { digest_interval: 2, digest_levels: 2 })
} else {
None
},
code: code.map(|x| x.to_vec()).unwrap_or_else(|| wasm_binary_unwrap().to_vec()),
},
indices: IndicesConfig {
indices: vec![],
},
balances: BalancesConfig {
balances: endowed,
},
indices: IndicesConfig { indices: vec![] },
balances: BalancesConfig { balances: endowed },
session: SessionConfig {
keys: vec![
(dave(), alice(), to_session_keys(
&Ed25519Keyring::Alice,
&Sr25519Keyring::Alice,
)),
(eve(), bob(), to_session_keys(
&Ed25519Keyring::Bob,
&Sr25519Keyring::Bob,
)),
(ferdie(), charlie(), to_session_keys(
&Ed25519Keyring::Charlie,
&Sr25519Keyring::Charlie,
)),
]
(dave(), alice(), to_session_keys(&Ed25519Keyring::Alice, &Sr25519Keyring::Alice)),
(eve(), bob(), to_session_keys(&Ed25519Keyring::Bob, &Sr25519Keyring::Bob)),
(
ferdie(),
charlie(),
to_session_keys(&Ed25519Keyring::Charlie, &Sr25519Keyring::Charlie),
),
],
},
staking: StakingConfig {
stakers: vec![
(dave(), alice(), 111 * DOLLARS, StakerStatus::Validator),
(eve(), bob(), 100 * DOLLARS, StakerStatus::Validator),
(ferdie(), charlie(), 100 * DOLLARS, StakerStatus::Validator)
(ferdie(), charlie(), 100 * DOLLARS, StakerStatus::Validator),
],
validator_count: 3,
minimum_validator_count: 0,
slash_reward_fraction: Perbill::from_percent(10),
invulnerables: vec![alice(), bob(), charlie()],
.. Default::default()
},
babe: BabeConfig {
authorities: vec![],
epoch_config: Some(BABE_GENESIS_EPOCH_CONFIG),
},
grandpa: GrandpaConfig {
authorities: vec![],
..Default::default()
},
babe: BabeConfig { authorities: vec![], epoch_config: Some(BABE_GENESIS_EPOCH_CONFIG) },
grandpa: GrandpaConfig { authorities: vec![] },
im_online: Default::default(),
authority_discovery: Default::default(),
democracy: Default::default(),
@@ -113,11 +96,7 @@ pub fn config_endowed(
elections: Default::default(),
sudo: Default::default(),
treasury: Default::default(),
society: SocietyConfig {
members: vec![alice(), bob()],
pot: 0,
max_members: 999,
},
society: SocietyConfig { members: vec![alice(), bob()], pot: 0, max_members: 999 },
vesting: Default::default(),
gilt: Default::default(),
transaction_storage: Default::default(),