@@ -68,51 +68,48 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
68
68
#[ cfg( feature = "frequency" ) ]
69
69
"frequency" => return Ok ( Box :: new ( chain_spec:: frequency:: load_frequency_spec ( ) ) ) ,
70
70
#[ cfg( feature = "frequency-no-relay" ) ]
71
- "dev" | "frequency-no-relay" => {
72
- return Ok ( Box :: new ( chain_spec:: frequency_rococo:: development_config ( ) ) )
73
- } ,
71
+ "dev" | "frequency-no-relay" =>
72
+ return Ok ( Box :: new ( chain_spec:: frequency_rococo:: development_config ( ) ) ) ,
74
73
#[ cfg( feature = "frequency-rococo-local" ) ]
75
- "frequency-rococo-local" => {
76
- return Ok ( Box :: new ( chain_spec:: frequency_rococo:: local_testnet_config ( ) ) )
77
- } ,
74
+ "frequency-rococo-local" =>
75
+ return Ok ( Box :: new ( chain_spec:: frequency_rococo:: local_testnet_config ( ) ) ) ,
78
76
#[ cfg( feature = "frequency-rococo-testnet" ) ]
79
- "frequency-rococo-testnet" | "frequency-rococo" | "rococo" | "testnet" => {
80
- return Ok ( Box :: new ( chain_spec:: frequency_rococo:: load_frequency_rococo_spec ( ) ) )
81
- } ,
77
+ "frequency-rococo-testnet" | "frequency-rococo" | "rococo" | "testnet" =>
78
+ return Ok ( Box :: new ( chain_spec:: frequency_rococo:: load_frequency_rococo_spec ( ) ) ) ,
82
79
path => {
83
80
if path. is_empty ( ) {
84
81
if cfg ! ( feature = "frequency" ) {
85
82
#[ cfg( feature = "frequency" ) ]
86
83
{
87
- return Ok ( Box :: new ( chain_spec:: frequency:: load_frequency_spec ( ) ) ) ;
84
+ return Ok ( Box :: new ( chain_spec:: frequency:: load_frequency_spec ( ) ) )
88
85
}
89
86
#[ cfg( not( feature = "frequency" ) ) ]
90
- return Err ( "Frequency runtime is not available." . into ( ) ) ;
87
+ return Err ( "Frequency runtime is not available." . into ( ) )
91
88
} else if cfg ! ( feature = "frequency-no-relay" ) {
92
89
#[ cfg( feature = "frequency-no-relay" ) ]
93
90
{
94
- return Ok ( Box :: new ( chain_spec:: frequency_rococo:: development_config ( ) ) ) ;
91
+ return Ok ( Box :: new ( chain_spec:: frequency_rococo:: development_config ( ) ) )
95
92
}
96
93
#[ cfg( not( feature = "frequency-no-relay" ) ) ]
97
- return Err ( "Frequency Development (no relay) runtime is not available." . into ( ) ) ;
94
+ return Err ( "Frequency Development (no relay) runtime is not available." . into ( ) )
98
95
} else if cfg ! ( feature = "frequency-rococo-local" ) {
99
96
#[ cfg( feature = "frequency-rococo-local" ) ]
100
97
{
101
- return Ok ( Box :: new ( chain_spec:: frequency_rococo:: local_testnet_config ( ) ) ) ;
98
+ return Ok ( Box :: new ( chain_spec:: frequency_rococo:: local_testnet_config ( ) ) )
102
99
}
103
100
#[ cfg( not( feature = "frequency-rococo-local" ) ) ]
104
- return Err ( "Frequency Local runtime is not available." . into ( ) ) ;
101
+ return Err ( "Frequency Local runtime is not available." . into ( ) )
105
102
} else if cfg ! ( feature = "frequency-rococo-testnet" ) {
106
103
#[ cfg( feature = "frequency-rococo-testnet" ) ]
107
104
{
108
105
return Ok ( Box :: new (
109
106
chain_spec:: frequency_rococo:: load_frequency_rococo_spec ( ) ,
110
- ) ) ;
107
+ ) )
111
108
}
112
109
#[ cfg( not( feature = "frequency-rococo-testnet" ) ) ]
113
- return Err ( "Frequency Rococo runtime is not available." . into ( ) ) ;
110
+ return Err ( "Frequency Rococo runtime is not available." . into ( ) )
114
111
} else {
115
- return Err ( "No chain spec is available." . into ( ) ) ;
112
+ return Err ( "No chain spec is available." . into ( ) )
116
113
}
117
114
}
118
115
let path_buf = std:: path:: PathBuf :: from ( path) ;
@@ -121,41 +118,39 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
121
118
if ChainIdentity :: Frequency == spec. identify ( ) {
122
119
#[ cfg( feature = "frequency" ) ]
123
120
{
124
- return Ok ( Box :: new ( chain_spec:: frequency:: ChainSpec :: from_json_file (
125
- path_buf,
126
- ) ?) ) ;
121
+ return Ok ( Box :: new ( chain_spec:: frequency:: ChainSpec :: from_json_file ( path_buf) ?) )
127
122
}
128
123
#[ cfg( not( feature = "frequency" ) ) ]
129
- return Err ( "Frequency runtime is not available." . into ( ) ) ;
124
+ return Err ( "Frequency runtime is not available." . into ( ) )
130
125
} else if ChainIdentity :: FrequencyRococo == spec. identify ( ) {
131
126
#[ cfg( feature = "frequency-rococo-testnet" ) ]
132
127
{
133
128
return Ok ( Box :: new ( chain_spec:: frequency_rococo:: ChainSpec :: from_json_file (
134
129
path_buf,
135
- ) ?) ) ;
130
+ ) ?) )
136
131
}
137
132
#[ cfg( not( feature = "frequency-rococo-testnet" ) ) ]
138
- return Err ( "Frequency Rococo runtime is not available." . into ( ) ) ;
133
+ return Err ( "Frequency Rococo runtime is not available." . into ( ) )
139
134
} else if ChainIdentity :: FrequencyLocal == spec. identify ( ) {
140
135
#[ cfg( feature = "frequency-rococo-local" ) ]
141
136
{
142
137
return Ok ( Box :: new ( chain_spec:: frequency_rococo:: ChainSpec :: from_json_file (
143
138
path_buf,
144
- ) ?) ) ;
139
+ ) ?) )
145
140
}
146
141
#[ cfg( not( feature = "frequency-rococo-local" ) ) ]
147
- return Err ( "Frequency Local runtime is not available." . into ( ) ) ;
142
+ return Err ( "Frequency Local runtime is not available." . into ( ) )
148
143
} else if ChainIdentity :: FrequencyDev == spec. identify ( ) {
149
144
#[ cfg( feature = "frequency-no-relay" ) ]
150
145
{
151
146
return Ok ( Box :: new ( chain_spec:: frequency_rococo:: ChainSpec :: from_json_file (
152
147
path_buf,
153
- ) ?) ) ;
148
+ ) ?) )
154
149
}
155
150
#[ cfg( not( feature = "frequency-no-relay" ) ) ]
156
- return Err ( "Frequency Dev (no relay) runtime is not available." . into ( ) ) ;
151
+ return Err ( "Frequency Dev (no relay) runtime is not available." . into ( ) )
157
152
} else {
158
- return Err ( "Unknown chain spec." . into ( ) ) ;
153
+ return Err ( "Unknown chain spec." . into ( ) )
159
154
}
160
155
} ,
161
156
}
@@ -328,28 +323,26 @@ pub fn run() -> Result<()> {
328
323
let runner = cli. create_runner ( cmd) ?;
329
324
330
325
match cmd {
331
- BenchmarkCmd :: Pallet ( cmd) => {
326
+ BenchmarkCmd :: Pallet ( cmd) =>
332
327
if cfg ! ( feature = "runtime-benchmarks" ) {
333
328
runner. sync_run ( |config| cmd. run :: < Block , ( ) > ( config) )
334
329
} else {
335
330
return Err ( "Benchmarking wasn't enabled when building the node. \
336
331
You can enable it with `--features runtime-benchmarks`."
337
- . into ( ) ) ;
338
- }
339
- } ,
332
+ . into ( ) )
333
+ } ,
340
334
BenchmarkCmd :: Block ( cmd) => runner. sync_run ( |config| {
341
335
let partials = new_partial ( & config, false ) ?;
342
336
cmd. run ( partials. client )
343
337
} ) ,
344
338
#[ cfg( not( feature = "runtime-benchmarks" ) ) ]
345
- BenchmarkCmd :: Storage ( _) => {
339
+ BenchmarkCmd :: Storage ( _) =>
346
340
return Err ( sc_cli:: Error :: Input (
347
341
"Compile with --features=runtime-benchmarks \
348
342
to enable storage benchmarks."
349
343
. into ( ) ,
350
344
)
351
- . into ( ) )
352
- } ,
345
+ . into ( ) ) ,
353
346
#[ cfg( feature = "runtime-benchmarks" ) ]
354
347
BenchmarkCmd :: Storage ( cmd) => runner. sync_run ( |config| {
355
348
let partials = new_partial ( & config, false ) ?;
@@ -373,9 +366,8 @@ pub fn run() -> Result<()> {
373
366
BenchmarkCmd :: Machine ( cmd) => runner. sync_run ( |config| {
374
367
cmd. run ( & config, frame_benchmarking_cli:: SUBSTRATE_REFERENCE_HARDWARE . clone ( ) )
375
368
} ) ,
376
- BenchmarkCmd :: Extrinsic ( _cmd) => {
377
- Err ( "Benchmarking command not implemented." . into ( ) )
378
- } ,
369
+ BenchmarkCmd :: Extrinsic ( _cmd) =>
370
+ Err ( "Benchmarking command not implemented." . into ( ) ) ,
379
371
}
380
372
} ,
381
373
0 commit comments