Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
914ce67f
Commit
914ce67f
authored
5 years ago
by
Marcio Diaz
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add dev chain as default chain for benchmarks. (#5204)
parent
e5e0ca73
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/utils/frame/benchmarking-cli/src/lib.rs
+11
-5
11 additions, 5 deletions
substrate/utils/frame/benchmarking-cli/src/lib.rs
with
11 additions
and
5 deletions
substrate/utils/frame/benchmarking-cli/src/lib.rs
+
11
−
5
View file @
914ce67f
...
...
@@ -14,13 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use
std
::{
fmt
::
Debug
,
path
::
PathBuf
};
use
sp_runtime
::{
BuildStorage
,
traits
::{
Block
as
BlockT
,
Header
as
HeaderT
,
NumberFor
}};
use
sc_client
::
StateMachine
;
use
sc_cli
::{
ExecutionStrategy
,
WasmExecutionMethod
,
VersionInfo
};
use
sc_client_db
::
BenchmarkingState
;
use
sc_service
::{
RuntimeGenesis
,
ChainSpecExtension
,
Configuration
,
ChainSpec
};
use
sc_executor
::{
NativeExecutor
,
NativeExecutionDispatch
};
use
std
::
fmt
::
Debug
;
use
codec
::{
Encode
,
Decode
};
use
frame_benchmarking
::
BenchmarkResults
;
...
...
@@ -168,14 +168,20 @@ impl BenchmarkCmd {
&
self
,
mut
config
:
&
mut
Configuration
<
G
,
E
>
,
spec_factory
:
impl
FnOnce
(
&
str
)
->
Result
<
Option
<
ChainSpec
<
G
,
E
>>
,
String
>
,
version
:
&
VersionInfo
,
_
version
:
&
VersionInfo
,
)
->
sc_cli
::
Result
<
()
>
where
G
:
RuntimeGenesis
,
E
:
ChainSpecExtension
,
{
self
.shared_params
.update_config
(
&
mut
config
,
spec_factory
,
version
)
?
;
// make sure to configure keystore
// Configure chain spec.
let
chain_key
=
self
.shared_params.chain
.clone
()
.unwrap_or
(
"dev"
.into
());
let
spec
=
match
spec_factory
(
&
chain_key
)
?
{
Some
(
spec
)
=>
spec
,
None
=>
ChainSpec
::
from_json_file
(
PathBuf
::
from
(
chain_key
))
?
};
config
.chain_spec
=
Some
(
spec
);
// Make sure to configure keystore.
config
.use_in_memory_keystore
()
?
;
Ok
(())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment