Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
nodes
rust
Duniter v2S
Commits
83ad8ef7
Commit
83ad8ef7
authored
1 year ago
by
bgallois
Committed by
Hugo Trentesaux
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix formatting
parent
897406fe
No related branches found
No related tags found
1 merge request
!256
Refactor node implementation
Pipeline
#36586
passed
1 year ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
node/src/command.rs
+1
-3
1 addition, 3 deletions
node/src/command.rs
node/src/service.rs
+10
-11
10 additions, 11 deletions
node/src/service.rs
with
11 additions
and
14 deletions
node/src/command.rs
+
1
−
3
View file @
83ad8ef7
...
@@ -20,8 +20,6 @@
...
@@ -20,8 +20,6 @@
pub
mod
key
;
pub
mod
key
;
pub
mod
utils
;
pub
mod
utils
;
#[cfg(feature
=
"gtest"
)]
use
crate
::
chain_spec
::
gtest
;
use
crate
::
cli
::{
Cli
,
Subcommand
};
use
crate
::
cli
::{
Cli
,
Subcommand
};
use
crate
::
service
::
runtime_executor
::
Executor
;
use
crate
::
service
::
runtime_executor
::
Executor
;
use
crate
::
service
::
RuntimeType
;
use
crate
::
service
::
RuntimeType
;
...
@@ -134,7 +132,7 @@ impl SubstrateCli for Cli {
...
@@ -134,7 +132,7 @@ impl SubstrateCli for Cli {
#[cfg(feature
=
"gtest"
)]
#[cfg(feature
=
"gtest"
)]
"gtest_live"
=>
{
"gtest_live"
=>
{
const
JSON_CLIENT_SPEC
:
&
str
=
"./node/specs/gtest_client-specs.yaml"
;
const
JSON_CLIENT_SPEC
:
&
str
=
"./node/specs/gtest_client-specs.yaml"
;
let
client_spec
:
gtest
::
ClientSpec
=
serde_yaml
::
from_slice
(
let
client_spec
:
chain_spec
::
gtest
::
ClientSpec
=
serde_yaml
::
from_slice
(
&
std
::
fs
::
read
(
&
std
::
fs
::
read
(
std
::
env
::
var
(
"DUNITER_CLIENT_SPEC"
)
std
::
env
::
var
(
"DUNITER_CLIENT_SPEC"
)
.unwrap_or_else
(|
_
|
JSON_CLIENT_SPEC
.to_string
()),
.unwrap_or_else
(|
_
|
JSON_CLIENT_SPEC
.to_string
()),
...
...
This diff is collapsed.
Click to expand it.
node/src/service.rs
+
10
−
11
View file @
83ad8ef7
...
@@ -29,6 +29,7 @@ use sc_consensus_manual_seal::{run_manual_seal, EngineCommand, ManualSealParams}
...
@@ -29,6 +29,7 @@ use sc_consensus_manual_seal::{run_manual_seal, EngineCommand, ManualSealParams}
use
sc_service
::
WarpSyncParams
;
use
sc_service
::
WarpSyncParams
;
use
sc_service
::{
error
::
Error
as
ServiceError
,
Configuration
,
PartialComponents
,
TaskManager
};
use
sc_service
::{
error
::
Error
as
ServiceError
,
Configuration
,
PartialComponents
,
TaskManager
};
use
sc_telemetry
::{
Telemetry
,
TelemetryWorker
};
use
sc_telemetry
::{
Telemetry
,
TelemetryWorker
};
use
sp_consensus_babe
::
inherents
::
InherentDataProvider
;
use
sp_core
::
H256
;
use
sp_core
::
H256
;
use
sp_runtime
::
traits
::
BlakeTwo256
;
use
sp_runtime
::
traits
::
BlakeTwo256
;
use
std
::{
sync
::
Arc
,
time
::
Duration
};
use
std
::{
sync
::
Arc
,
time
::
Duration
};
...
@@ -256,8 +257,7 @@ where
...
@@ -256,8 +257,7 @@ where
create_inherent_data_providers
:
move
|
_
,
()|
async
move
{
create_inherent_data_providers
:
move
|
_
,
()|
async
move
{
let
timestamp
=
sp_timestamp
::
InherentDataProvider
::
from_system_time
();
let
timestamp
=
sp_timestamp
::
InherentDataProvider
::
from_system_time
();
let
slot
=
let
slot
=
InherentDataProvider
::
from_timestamp_and_slot_duration
(
sp_consensus_babe
::
inherents
::
InherentDataProvider
::
from_timestamp_and_slot_duration
(
*
timestamp
,
*
timestamp
,
slot_duration
,
slot_duration
,
);
);
...
@@ -477,7 +477,7 @@ where
...
@@ -477,7 +477,7 @@ where
client
.clone
(),
client
.clone
(),
)
)
.map_err
(|
err
|
format!
(
"{:?}"
,
err
))
?
;
.map_err
(|
err
|
format!
(
"{:?}"
,
err
))
?
;
let
babe
=
sp_consensus_babe
::
inherents
::
InherentDataProvider
::
new
(
let
babe
=
InherentDataProvider
::
new
(
timestamp
.slot
(),
timestamp
.slot
(),
);
);
let
distance
=
let
distance
=
...
@@ -517,8 +517,7 @@ where
...
@@ -517,8 +517,7 @@ where
async
move
{
async
move
{
let
timestamp
=
sp_timestamp
::
InherentDataProvider
::
from_system_time
();
let
timestamp
=
sp_timestamp
::
InherentDataProvider
::
from_system_time
();
let
slot
=
let
slot
=
InherentDataProvider
::
from_timestamp_and_slot_duration
(
sp_consensus_babe
::
inherents
::
InherentDataProvider
::
from_timestamp_and_slot_duration
(
*
timestamp
,
*
timestamp
,
slot_duration
,
slot_duration
,
);
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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