Skip to content

Commit 199cd21

Browse files
rphmeierpepyakin
authored andcommitted
chore: fmt after update
1 parent 1c068d6 commit 199cd21

File tree

4 files changed

+154
-155
lines changed

4 files changed

+154
-155
lines changed

sugondat-chain/node/src/chain_spec/mod.rs

Lines changed: 87 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,18 @@ pub fn development_config() -> TestRuntimeChainSpec {
8383
properties.insert("ss58Format".into(), 42.into());
8484

8585
TestRuntimeChainSpec::builder(
86-
sugondat_test_runtime::WASM_BINARY
87-
.expect("WASM binary was not built, please build it!"),
88-
Extensions {
89-
relay_chain: "rococo-local".into(),
90-
// You MUST set this to the correct network!
91-
para_id: 1000,
92-
},
93-
)
94-
.with_name("Development")
95-
.with_id("dev")
86+
sugondat_test_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
87+
Extensions {
88+
relay_chain: "rococo-local".into(),
89+
// You MUST set this to the correct network!
90+
para_id: 1000,
91+
},
92+
)
93+
.with_name("Development")
94+
.with_id("dev")
9695
.with_properties(properties)
97-
.with_chain_type(ChainType::Development)
98-
.with_genesis_config_patch(test_runtime_genesis_patch(
96+
.with_chain_type(ChainType::Development)
97+
.with_genesis_config_patch(test_runtime_genesis_patch(
9998
// initial collators.
10099
vec![
101100
(
@@ -124,7 +123,7 @@ pub fn development_config() -> TestRuntimeChainSpec {
124123
get_account_id_from_seed::<sr25519::Public>("Alice"),
125124
1000.into(),
126125
))
127-
.build()
126+
.build()
128127
}
129128

130129
const KUSAMA_PARA_ID: u32 = 3338;
@@ -138,20 +137,19 @@ pub fn kusama_staging_config() -> KusamaRuntimeChainSpec {
138137
properties.insert("ss58Format".into(), 2.into());
139138

140139
KusamaRuntimeChainSpec::builder(
141-
sugondat_kusama_runtime::WASM_BINARY
142-
.expect("WASM binary was not built, please build it!"),
143-
Extensions {
144-
relay_chain: "kusama".into(),
145-
// You MUST set this to the correct network!
146-
para_id: KUSAMA_PARA_ID,
147-
},
148-
)
149-
.with_name("Kusama Blobs Staging")
150-
.with_id("blobs_kusama_staging")
140+
sugondat_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
141+
Extensions {
142+
relay_chain: "kusama".into(),
143+
// You MUST set this to the correct network!
144+
para_id: KUSAMA_PARA_ID,
145+
},
146+
)
147+
.with_name("Kusama Blobs Staging")
148+
.with_id("blobs_kusama_staging")
151149
.with_protocol_id("sugondat-kusama")
152150
.with_properties(properties)
153-
.with_chain_type(ChainType::Local)
154-
.with_genesis_config_patch(kusama_runtime_genesis_patch(
151+
.with_chain_type(ChainType::Local)
152+
.with_genesis_config_patch(kusama_runtime_genesis_patch(
155153
// initial collators
156154
vec![
157155
(
@@ -167,7 +165,7 @@ pub fn kusama_staging_config() -> KusamaRuntimeChainSpec {
167165
get_account_id_from_seed::<sr25519::Public>("Alice"),
168166
KUSAMA_PARA_ID.into(),
169167
))
170-
.build()
168+
.build()
171169
}
172170

173171
pub fn local_testnet_config() -> TestRuntimeChainSpec {
@@ -177,21 +175,20 @@ pub fn local_testnet_config() -> TestRuntimeChainSpec {
177175
properties.insert("tokenDecimals".into(), 12.into());
178176
properties.insert("ss58Format".into(), 42.into());
179177

180-
TestRuntimeChainSpec::builder(
181-
sugondat_test_runtime::WASM_BINARY
182-
.expect("WASM binary was not built, please build it!"),
183-
Extensions {
184-
relay_chain: "rococo-local".into(),
185-
// You MUST set this to the correct network!
186-
para_id: 1000,
187-
},
188-
)
189-
.with_name("Local Testnet")
190-
.with_id("local_testnet")
178+
TestRuntimeChainSpec::builder(
179+
sugondat_test_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
180+
Extensions {
181+
relay_chain: "rococo-local".into(),
182+
// You MUST set this to the correct network!
183+
para_id: 1000,
184+
},
185+
)
186+
.with_name("Local Testnet")
187+
.with_id("local_testnet")
191188
.with_protocol_id("sugondat-local")
192189
.with_properties(properties)
193-
.with_chain_type(ChainType::Local)
194-
.with_genesis_config_patch(test_runtime_genesis_patch(
190+
.with_chain_type(ChainType::Local)
191+
.with_genesis_config_patch(test_runtime_genesis_patch(
195192
// initial collators.
196193
vec![
197194
(
@@ -220,7 +217,7 @@ pub fn local_testnet_config() -> TestRuntimeChainSpec {
220217
get_account_id_from_seed::<sr25519::Public>("Alice"),
221218
1000.into(),
222219
))
223-
.build()
220+
.build()
224221
}
225222

226223
fn test_runtime_genesis_patch(
@@ -231,31 +228,31 @@ fn test_runtime_genesis_patch(
231228
) -> serde_json::Value {
232229
serde_json::json! ({
233230
"balances": {
234-
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
235-
},
236-
"parachainInfo": {
237-
"parachainId": id,
238-
},
239-
"collatorSelection": {
240-
"invulnerables": invulnerables.iter().cloned().map(|(acc, _)| acc).collect::<Vec<_>>(),
241-
"candidacyBond": TEST_EXISTENTIAL_DEPOSIT * 16,
242-
},
243-
"session": {
244-
"keys": invulnerables
245-
.into_iter()
246-
.map(|(acc, aura)| {
247-
(
248-
acc.clone(), // account id
249-
acc, // validator id
250-
test_runtime_session_keys(aura), // session keys
251-
)
252-
})
253-
.collect::<Vec<_>>(),
254-
},
255-
"polkadotXcm": {
256-
"safeXcmVersion": Some(SAFE_XCM_VERSION),
257-
},
258-
"sudo": { "key": Some(root) }
231+
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
232+
},
233+
"parachainInfo": {
234+
"parachainId": id,
235+
},
236+
"collatorSelection": {
237+
"invulnerables": invulnerables.iter().cloned().map(|(acc, _)| acc).collect::<Vec<_>>(),
238+
"candidacyBond": TEST_EXISTENTIAL_DEPOSIT * 16,
239+
},
240+
"session": {
241+
"keys": invulnerables
242+
.into_iter()
243+
.map(|(acc, aura)| {
244+
(
245+
acc.clone(), // account id
246+
acc, // validator id
247+
test_runtime_session_keys(aura), // session keys
248+
)
249+
})
250+
.collect::<Vec<_>>(),
251+
},
252+
"polkadotXcm": {
253+
"safeXcmVersion": Some(SAFE_XCM_VERSION),
254+
},
255+
"sudo": { "key": Some(root) }
259256
})
260257
}
261258

@@ -267,30 +264,30 @@ fn kusama_runtime_genesis_patch(
267264
) -> serde_json::Value {
268265
serde_json::json! ({
269266
"balances": {
270-
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
271-
},
272-
"parachainInfo": {
273-
"parachainId": id,
274-
},
275-
"collatorSelection": {
276-
"invulnerables": invulnerables.iter().cloned().map(|(acc, _)| acc).collect::<Vec<_>>(),
277-
"candidacyBond": TEST_EXISTENTIAL_DEPOSIT * 16,
278-
},
279-
"session": {
280-
"keys": invulnerables
281-
.into_iter()
282-
.map(|(acc, aura)| {
283-
(
284-
acc.clone(), // account id
285-
acc, // validator id
286-
kusama_runtime_session_keys(aura), // session keys
287-
)
288-
})
289-
.collect::<Vec<_>>(),
290-
},
291-
"polkadotXcm": {
292-
"safeXcmVersion": Some(SAFE_XCM_VERSION),
293-
},
294-
"sudo": { "key": Some(root) }
267+
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
268+
},
269+
"parachainInfo": {
270+
"parachainId": id,
271+
},
272+
"collatorSelection": {
273+
"invulnerables": invulnerables.iter().cloned().map(|(acc, _)| acc).collect::<Vec<_>>(),
274+
"candidacyBond": TEST_EXISTENTIAL_DEPOSIT * 16,
275+
},
276+
"session": {
277+
"keys": invulnerables
278+
.into_iter()
279+
.map(|(acc, aura)| {
280+
(
281+
acc.clone(), // account id
282+
acc, // validator id
283+
kusama_runtime_session_keys(aura), // session keys
284+
)
285+
})
286+
.collect::<Vec<_>>(),
287+
},
288+
"polkadotXcm": {
289+
"safeXcmVersion": Some(SAFE_XCM_VERSION),
290+
},
291+
"sudo": { "key": Some(root) }
295292
})
296293
}

sugondat-chain/node/src/service.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,15 @@ async fn start_node_impl(
260260
// Here you can check whether the hardware meets your chains' requirements. Putting a link
261261
// in there and swapping out the requirements for your own are probably a good idea. The
262262
// requirements for a para-chain are dictated by its relay-chain.
263-
match SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench) {
264-
Err(err) if validator => {
265-
log::warn!(
263+
match SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench) {
264+
Err(err) if validator => {
265+
log::warn!(
266266
"⚠️ The hardware does not meet the minimal requirements {} for role 'Authority'.",
267267
err
268268
);
269-
},
270-
_ => {},
271-
}
269+
}
270+
_ => {}
271+
}
272272

273273
if let Some(ref mut telemetry) = telemetry {
274274
let telemetry_handle = telemetry.handle();
@@ -422,7 +422,7 @@ fn start_consensus(
422422
collator_service,
423423
// Very limited proposal time.
424424
authoring_duration: Duration::from_millis(500),
425-
collation_request_receiver: None,
425+
collation_request_receiver: None,
426426
};
427427

428428
let fut =

sugondat-chain/runtimes/sugondat-kusama/src/lib.rs

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ mod constants;
1010
mod weights;
1111
pub mod xcm_config;
1212

13-
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
1413
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
14+
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
15+
use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery;
1516
use sp_api::impl_runtime_apis;
1617
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
1718
use sp_runtime::{
@@ -20,7 +21,6 @@ use sp_runtime::{
2021
transaction_validity::{TransactionSource, TransactionValidity},
2122
ApplyExtrinsicResult,
2223
};
23-
use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery;
2424

2525
use sp_std::prelude::*;
2626
#[cfg(feature = "std")]
@@ -34,7 +34,9 @@ use frame_support::{
3434
dispatch::DispatchClass,
3535
genesis_builder_helper::{build_config, create_default_config},
3636
parameter_types,
37-
traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, TransformOrigin},
37+
traits::{
38+
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, TransformOrigin,
39+
},
3840
weights::{ConstantMultiplier, Weight},
3941
PalletId,
4042
};
@@ -244,7 +246,7 @@ impl pallet_balances::Config for Runtime {
244246
type MaxReserves = ConstU32<50>;
245247
type ReserveIdentifier = [u8; 8];
246248
type RuntimeHoldReason = RuntimeHoldReason;
247-
type RuntimeFreezeReason = RuntimeFreezeReason;
249+
type RuntimeFreezeReason = RuntimeFreezeReason;
248250
type FreezeIdentifier = ();
249251
type MaxHolds = ConstU32<0>;
250252
type MaxFreezes = ConstU32<0>;
@@ -273,11 +275,11 @@ impl pallet_sudo::Config for Runtime {
273275
parameter_types! {
274276
pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
275277
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
276-
pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
278+
pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
277279
}
278280

279281
impl cumulus_pallet_parachain_system::Config for Runtime {
280-
type WeightInfo = ();
282+
type WeightInfo = ();
281283
type RuntimeEvent = RuntimeEvent;
282284
type OnSystemEvent = ();
283285
type SelfParaId = parachain_info::Pallet<Runtime>;
@@ -297,31 +299,30 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
297299

298300
impl parachain_info::Config for Runtime {}
299301

300-
301302
parameter_types! {
302-
pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block;
303+
pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block;
303304
}
304305

305306
impl pallet_message_queue::Config for Runtime {
306-
type RuntimeEvent = RuntimeEvent;
307-
type WeightInfo = ();
308-
#[cfg(feature = "runtime-benchmarks")]
309-
type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor<
310-
cumulus_primitives_core::AggregateMessageOrigin,
311-
>;
312-
#[cfg(not(feature = "runtime-benchmarks"))]
313-
type MessageProcessor = xcm_builder::ProcessXcmMessage<
314-
AggregateMessageOrigin,
315-
xcm_executor::XcmExecutor<xcm_config::XcmConfig>,
316-
RuntimeCall,
317-
>;
318-
type Size = u32;
319-
// The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin:
320-
type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
321-
type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
322-
type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>;
323-
type MaxStale = sp_core::ConstU32<8>;
324-
type ServiceWeight = MessageQueueServiceWeight;
307+
type RuntimeEvent = RuntimeEvent;
308+
type WeightInfo = ();
309+
#[cfg(feature = "runtime-benchmarks")]
310+
type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor<
311+
cumulus_primitives_core::AggregateMessageOrigin,
312+
>;
313+
#[cfg(not(feature = "runtime-benchmarks"))]
314+
type MessageProcessor = xcm_builder::ProcessXcmMessage<
315+
AggregateMessageOrigin,
316+
xcm_executor::XcmExecutor<xcm_config::XcmConfig>,
317+
RuntimeCall,
318+
>;
319+
type Size = u32;
320+
// The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin:
321+
type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
322+
type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
323+
type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>;
324+
type MaxStale = sp_core::ConstU32<8>;
325+
type ServiceWeight = MessageQueueServiceWeight;
325326
}
326327

327328
impl cumulus_pallet_aura_ext::Config for Runtime {}
@@ -331,8 +332,8 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
331332
type ChannelInfo = ParachainSystem;
332333
type VersionWrapper = ();
333334
// Enqueue XCMP messages from siblings for later processing.
334-
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
335-
type MaxInboundSuspended = sp_core::ConstU32<1_000>;
335+
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
336+
type MaxInboundSuspended = sp_core::ConstU32<1_000>;
336337
type ControllerOrigin = EnsureRoot<AccountId>;
337338
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
338339
type WeightInfo = ();

0 commit comments

Comments
 (0)