Skip to content

Commit 28f6fc6

Browse files
committed
minor refactoring and linting
1 parent 296c974 commit 28f6fc6

File tree

7 files changed

+103
-109
lines changed

7 files changed

+103
-109
lines changed

node/src/chain_spec.rs

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ use crate::fixtures::get_allocation;
22
use cumulus_primitives_core::ParaId;
33
use datahighway_parachain_runtime::{
44
AuraId,
5-
// AuthorityDiscoveryConfig,
65
AuraConfig,
76
BalancesConfig,
87
CollatorSelectionConfig,
98
GenesisConfig,
109
IndicesConfig,
1110
SessionConfig,
12-
// SessionKeys,
11+
SessionKeys,
1312
SudoConfig,
14-
// SystemConfig,
13+
SystemConfig,
1514
TransactionPaymentConfig,
1615
TreasuryConfig,
1716
};
@@ -20,7 +19,7 @@ use module_primitives::{
2019
DOLLARS,
2120
EXISTENTIAL_DEPOSIT,
2221
},
23-
types::{
22+
types::{
2423
AccountId,
2524
Balance,
2625
Signature,
@@ -78,7 +77,7 @@ const KUSAMA_LOCAL_PROTOCOL_ID: &str = "dhx-kusama-local";
7877
const KUSAMA_TANGANIKA_PROTOCOL_ID: &str = "dhx-kusama-tanganika";
7978

8079
/// Specialized `ChainSpec` for the normal parachain runtime.
81-
pub type ChainSpec = sc_service::GenericChainSpec<datahighway_parachain_runtime::GenesisConfig, Extensions>;
80+
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;
8281

8382
// Note this is the URL for the telemetry server
8483
const POLKADOT_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
@@ -129,8 +128,8 @@ where
129128
/// Generate the session keys from individual elements.
130129
///
131130
/// The input must be a tuple of individual keys (a single arg for now since we have just one key).
132-
pub fn datahighway_session_keys(keys: AuraId) -> datahighway_parachain_runtime::SessionKeys {
133-
datahighway_parachain_runtime::SessionKeys { aura: keys }
131+
pub fn datahighway_session_keys(keys: AuraId) -> SessionKeys {
132+
SessionKeys { aura: keys }
134133
}
135134

136135
// DHX DAO Unlocked Reserves Balance
@@ -1182,7 +1181,7 @@ fn spreehafen_testnet_genesis(
11821181
let hardspoon_balances = get_balances(endowed_accounts.clone());
11831182

11841183
GenesisConfig {
1185-
system: datahighway_parachain_runtime::SystemConfig {
1184+
system: SystemConfig {
11861185
code: datahighway_parachain_runtime::WASM_BINARY.expect("WASM binary was not build, please build it!").to_vec(),
11871186
},
11881187
balances: BalancesConfig {
@@ -1219,8 +1218,7 @@ fn spreehafen_testnet_genesis(
12191218
})
12201219
.collect(),
12211220
},
1222-
// no need to pass anything to aura, in fact it will panic if we do. Session will take care
1223-
// of this.
1221+
// it will panic if we pass anything to Aura. Session will take care of this instead.
12241222
aura: Default::default(),
12251223
transaction_payment: TransactionPaymentConfig::default(),
12261224
aura_ext: Default::default(),
@@ -1242,7 +1240,7 @@ fn testnet_genesis(
12421240
let hardspoon_balances = get_balances(endowed_accounts.clone());
12431241

12441242
GenesisConfig {
1245-
system: datahighway_parachain_runtime::SystemConfig {
1243+
system: SystemConfig {
12461244
code: datahighway_parachain_runtime::WASM_BINARY.expect("WASM binary was not build, please build it!").to_vec(),
12471245
},
12481246
balances: BalancesConfig {
@@ -1279,8 +1277,7 @@ fn testnet_genesis(
12791277
})
12801278
.collect(),
12811279
},
1282-
// no need to pass anything to aura, in fact it will panic if we do. Session will take care
1283-
// of this.
1280+
// it will panic if we pass anything to Aura. Session will take care of this instead.
12841281
aura: Default::default(),
12851282
transaction_payment: TransactionPaymentConfig::default(),
12861283
aura_ext: Default::default(),
@@ -1297,12 +1294,12 @@ fn dev_genesis(
12971294
endowed_accounts: Vec<AccountId>,
12981295
id: ParaId,
12991296
_enable_println: bool,
1300-
) -> datahighway_parachain_runtime::GenesisConfig {
1297+
) -> GenesisConfig {
13011298
let num_endowed_accounts = endowed_accounts.len();
13021299
let hardspoon_balances = get_balances(endowed_accounts.clone());
13031300

1304-
datahighway_parachain_runtime::GenesisConfig {
1305-
system: datahighway_parachain_runtime::SystemConfig {
1301+
GenesisConfig {
1302+
system: SystemConfig {
13061303
code: datahighway_parachain_runtime::WASM_BINARY.expect("WASM binary was not build, please build it!").to_vec(),
13071304
},
13081305
balances: BalancesConfig {
@@ -1339,8 +1336,7 @@ fn dev_genesis(
13391336
})
13401337
.collect(),
13411338
},
1342-
// no need to pass anything to aura, in fact it will panic if we do. Session will take care
1343-
// of this.
1339+
// it will panic if we pass anything to Aura. Session will take care of this instead.
13441340
aura: Default::default(),
13451341
transaction_payment: TransactionPaymentConfig::default(),
13461342
aura_ext: Default::default(),
@@ -1361,7 +1357,7 @@ fn baikal_testnet_genesis(
13611357
let num_endowed_accounts = endowed_accounts.len();
13621358

13631359
GenesisConfig {
1364-
system: datahighway_parachain_runtime::SystemConfig {
1360+
system: SystemConfig {
13651361
code: datahighway_parachain_runtime::WASM_BINARY.expect("WASM binary was not build, please build it!").to_vec(),
13661362
},
13671363
balances: BalancesConfig {
@@ -1410,8 +1406,7 @@ fn baikal_testnet_genesis(
14101406
})
14111407
.collect(),
14121408
},
1413-
// no need to pass anything to aura, in fact it will panic if we do. Session will take care
1414-
// of this.
1409+
// it will panic if we pass anything to Aura. Session will take care of this instead.
14151410
aura: Default::default(),
14161411
transaction_payment: TransactionPaymentConfig::default(),
14171412
aura_ext: Default::default(),
@@ -1433,7 +1428,7 @@ fn tanganika_testnet_genesis(
14331428
let hardspoon_balances = get_balances(endowed_accounts.clone());
14341429

14351430
GenesisConfig {
1436-
system: datahighway_parachain_runtime::SystemConfig {
1431+
system: SystemConfig {
14371432
code: datahighway_parachain_runtime::WASM_BINARY.expect("WASM binary was not build, please build it!").to_vec(),
14381433
},
14391434
balances: BalancesConfig {
@@ -1470,8 +1465,7 @@ fn tanganika_testnet_genesis(
14701465
})
14711466
.collect(),
14721467
},
1473-
// no need to pass anything to aura, in fact it will panic if we do. Session will take care
1474-
// of this.
1468+
// it will panic if we pass anything to Aura. Session will take care of this instead.
14751469
aura: Default::default(),
14761470
transaction_payment: TransactionPaymentConfig::default(),
14771471
aura_ext: Default::default(),

node/src/rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::sync::Arc;
99

1010
use datahighway_parachain_runtime::{opaque::Block};
1111
use module_primitives::{
12-
types::{
12+
types::{
1313
AccountId,
1414
Balance,
1515
Index as Nonce,

node/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use datahighway_parachain_runtime::{
88
opaque::{Block, Header}, RuntimeApi,
99
};
1010
use module_primitives::{
11-
types::{
11+
types::{
1212
AccountId,
1313
Balance,
1414
Hash,

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub use frame_support::{
4242
DispatchClass, IdentityFee, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients,
4343
WeightToFeePolynomial,
4444
},
45-
PalletId,
45+
PalletId,
4646
RuntimeDebug,
4747
StorageValue,
4848
};

scripts/benchmark_all_pallets.sh

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -8,79 +8,79 @@ COLLATOR=./target/release/datahighway-collator
88
mkdir -p $DATAHIGHWAY_RUNTIME_WEIGHT_DIR
99

1010
pallets=(
11-
"frame_system" \
12-
"cumulus_pallet_parachain_system" \
13-
"pallet_utility" \
14-
"pallet_timestamp" \
15-
"pallet_identity" \
16-
"pallet_scheduler" \
17-
"parachain_info" \
18-
"pallet_indices" \
19-
"pallet_balances" \
20-
"pallet_transaction_payment" \
21-
"pallet_collator_selection" \
22-
"pallet_democracy" \
23-
"pallet_xcm" \
24-
"pallet_collective" \
25-
"pallet_elections_phragmen" \
26-
"pallet_membership" \
27-
"pallet_treasury" \
28-
"pallet_bounties" \
29-
"pallet_child_bounties" \
30-
"pallet_tips" \
31-
"pallet_preimage" \
32-
"pallet_proxy" \
33-
"pallet_multisig" \
34-
"pallet_referenda" \
35-
"pallet_conviction_voting" \
36-
"membership_supernodes" \
37-
"roaming_operators" \
38-
"roaming_networks" \
39-
"roaming_organizations" \
40-
"roaming_network_servers" \
41-
"roaming_devices" \
42-
"roaming_routing_profiles" \
43-
"roaming_service_profiles" \
44-
"roaming_accounting_policies" \
45-
"roaming_agreement_policies" \
46-
"roaming_network_profiles" \
47-
"roaming_device_profiles" \
48-
"roaming_sessions" \
49-
"roaming_billing_policies" \
50-
"roaming_charging_policies" \
51-
"roaming_packet_bundles" \
52-
"mining_setting_token" \
53-
"mining_setting_hardware" \
54-
"mining_rates_token" \
55-
"mining_rates_hardware" \
56-
"mining_sampling_token" \
57-
"mining_sampling_hardware" \
58-
"mining_eligibility_token" \
59-
"mining_eligibility_hardware" \
60-
"mining_eligibility_proxy" \
61-
"mining_lodgements_hardware" \
62-
"mining_claims_token" \
63-
"mining_claims_hardware" \
64-
"mining_execution_token" \
65-
"exchange_rate" \
66-
"treasury_dao" \
11+
"frame_system" \
12+
"cumulus_pallet_parachain_system" \
13+
"pallet_utility" \
14+
"pallet_timestamp" \
15+
"pallet_identity" \
16+
"pallet_scheduler" \
17+
"parachain_info" \
18+
"pallet_indices" \
19+
"pallet_balances" \
20+
"pallet_transaction_payment" \
21+
"pallet_collator_selection" \
22+
"pallet_democracy" \
23+
"pallet_xcm" \
24+
"pallet_collective" \
25+
"pallet_elections_phragmen" \
26+
"pallet_membership" \
27+
"pallet_treasury" \
28+
"pallet_bounties" \
29+
"pallet_child_bounties" \
30+
"pallet_tips" \
31+
"pallet_preimage" \
32+
"pallet_proxy" \
33+
"pallet_multisig" \
34+
"pallet_referenda" \
35+
"pallet_conviction_voting" \
36+
"membership_supernodes" \
37+
"roaming_operators" \
38+
"roaming_networks" \
39+
"roaming_organizations" \
40+
"roaming_network_servers" \
41+
"roaming_devices" \
42+
"roaming_routing_profiles" \
43+
"roaming_service_profiles" \
44+
"roaming_accounting_policies" \
45+
"roaming_agreement_policies" \
46+
"roaming_network_profiles" \
47+
"roaming_device_profiles" \
48+
"roaming_sessions" \
49+
"roaming_billing_policies" \
50+
"roaming_charging_policies" \
51+
"roaming_packet_bundles" \
52+
"mining_setting_token" \
53+
"mining_setting_hardware" \
54+
"mining_rates_token" \
55+
"mining_rates_hardware" \
56+
"mining_sampling_token" \
57+
"mining_sampling_hardware" \
58+
"mining_eligibility_token" \
59+
"mining_eligibility_hardware" \
60+
"mining_eligibility_proxy" \
61+
"mining_lodgements_hardware" \
62+
"mining_claims_token" \
63+
"mining_claims_hardware" \
64+
"mining_execution_token" \
65+
"exchange_rate" \
66+
"treasury_dao" \
6767
)
6868

6969
for pallet in ${pallets[*]}; do
70-
echo benchmarking "$pallet"...
70+
echo benchmarking "$pallet"...
7171

72-
cargo build --release \
73-
--features runtime-benchmarks \
72+
cargo build --release \
73+
--features runtime-benchmarks \
7474

75-
$COLLATOR \
76-
benchmark \
77-
--chain=rococo-local \
78-
--steps=50 \
79-
--repeat=20 \
80-
--pallet="$pallet" \
81-
--extrinsic="*" \
82-
--execution=wasm \
83-
--wasm-execution=compiled \
84-
--heap-pages=4096 \
85-
--output=./$DATAHIGHWAY_RUNTIME_WEIGHT_DIR/"$pallet".rs \
75+
$COLLATOR \
76+
benchmark \
77+
--chain=rococo-local \
78+
--steps=50 \
79+
--repeat=20 \
80+
--pallet="$pallet" \
81+
--extrinsic="*" \
82+
--execution=wasm \
83+
--wasm-execution=compiled \
84+
--heap-pages=4096 \
85+
--output=./$DATAHIGHWAY_RUNTIME_WEIGHT_DIR/"$pallet".rs \
8686
done

scripts/dump_wasm_and_state_for_all_chains.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ mkdir -p ${DUMP_DIR}
1919

2020
# Note: chachacha and polkadot have been omitted
2121
chainspecs=(
22-
"rococo-dev" \
23-
"rococo-local" \
24-
"rococo" \
25-
"kusama" \
26-
"kusama-dev" \
27-
"kusama-local" \
28-
"kusama" \
29-
)
22+
"rococo-dev" \
23+
"rococo-local" \
24+
"rococo" \
25+
"kusama" \
26+
"kusama-dev" \
27+
"kusama-local" \
28+
"kusama" \
29+
)
3030

3131
$COLLATOR --version
3232
# Print array values in lines

traits/account-set/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ license = 'GPL-3.0-or-later'
99

1010
[package.metadata.substrate]
1111
categories = [
12-
'trait',
13-
'accounts',
14-
'recipe',
12+
'trait',
13+
'accounts',
14+
'recipe',
1515
]
1616
compatibility_version = '2.0.0'
1717

@@ -22,7 +22,7 @@ std = [
2222
'frame-support/std',
2323
'frame-system/std',
2424
'frame-benchmarking/std',
25-
'sp-std/std',
25+
'sp-std/std',
2626
]
2727
try-runtime = ['frame-support/try-runtime']
2828

0 commit comments

Comments
 (0)