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
91d3c092
Commit
91d3c092
authored
1 year ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
fix(
#132
): fix: gtest build was failing due to rebase
parent
25dc7f3c
No related branches found
No related tags found
1 merge request
!182
Resolve "Industrialize Releases production"
Pipeline
#34143
failed
1 year ago
Stage: build
Stage: tests
Stage: deploy
Stage: deploy_readme
Changes
2
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
node/src/chain_spec/gen_genesis_data.rs
+1
-0
1 addition, 0 deletions
node/src/chain_spec/gen_genesis_data.rs
node/src/chain_spec/gtest.rs
+6
-50
6 additions, 50 deletions
node/src/chain_spec/gtest.rs
with
7 additions
and
50 deletions
node/src/chain_spec/gen_genesis_data.rs
+
1
−
0
View file @
91d3c092
...
...
@@ -1431,6 +1431,7 @@ fn decorate_smiths_with_identity(
.collect
()
}
#[cfg(feature
=
"gdev"
)]
pub
fn
generate_genesis_data_for_local_chain
<
P
,
SK
,
SessionKeys
:
Encode
,
SKP
>
(
initial_authorities_len
:
usize
,
initial_smiths_len
:
usize
,
...
...
This diff is collapsed.
Click to expand it.
node/src/chain_spec/gtest.rs
+
6
−
50
View file @
91d3c092
...
...
@@ -15,21 +15,15 @@
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
use
super
::
*
;
use
crate
::
chain_spec
::
gen_genesis_data
::{
CommonParameters
,
GenesisData
,
GenesisIdentity
,
SessionKeysProvider
,
};
use
crate
::
chain_spec
::
gen_genesis_data
::{
CommonParameters
,
GenesisIdentity
,
SessionKeysProvider
};
use
common_runtime
::
constants
::
*
;
use
common_runtime
::
entities
::
IdtyData
;
use
common_runtime
::
*
;
use
gtest_runtime
::{
opaque
::
SessionKeys
,
opaque
::
SessionKeys
,
parameters
,
AccountConfig
,
AccountConfig
,
AccountId
,
AccountId
,
AuthorityMembersConfig
,
AuthorityMembersConfig
,
BabeConfig
,
BabeConfig
,
BalancesConfig
,
CertConfig
,
CertConfig
,
GenesisConfig
,
GenesisConfig
,
IdentityConfig
,
IdentityConfig
,
ImOnlineId
,
ImOnlineId
,
MembershipConfig
,
MembershipConfig
,
Perbill
,
SessionConfig
,
SessionConfig
,
SmithCertConfig
,
SmithCertConfig
,
SmithMembershipConfig
,
SmithMembershipConfig
,
SudoConfig
,
SudoConfig
,
SystemConfig
,
SystemConfig
,
TechnicalCommitteeConfig
,
TechnicalCommitteeConfig
,
UniversalDividendConfig
,
UniversalDividendConfig
,
WASM_BINARY
,
WASM_BINARY
,
opaque
::
SessionKeys
,
parameters
,
AccountConfig
,
AccountId
,
AuthorityMembersConfig
,
BabeConfig
,
BalancesConfig
,
CertConfig
,
GenesisConfig
,
IdentityConfig
,
ImOnlineId
,
MembershipConfig
,
Perbill
,
SessionConfig
,
SmithCertConfig
,
SmithMembershipConfig
,
SudoConfig
,
SystemConfig
,
TechnicalCommitteeConfig
,
UniversalDividendConfig
,
WASM_BINARY
,
};
use
jsonrpsee
::
core
::
JsonValue
;
use
sc_consensus_grandpa
::
AuthorityId
as
GrandpaId
;
...
...
@@ -39,9 +33,6 @@ use sc_telemetry::TelemetryEndpoints;
use
serde
::
Deserialize
;
use
sp_authority_discovery
::
AuthorityId
as
AuthorityDiscoveryId
;
use
sp_consensus_babe
::
AuthorityId
as
BabeId
;
use
sp_core
::{
blake2_256
,
sr25519
,
Encode
,
H256
};
use
sp_membership
::
MembershipData
;
use
std
::
collections
::
BTreeMap
;
use
std
::{
env
,
fs
};
pub
type
ChainSpec
=
sc_service
::
GenericChainSpec
<
GenesisConfig
>
;
...
...
@@ -94,41 +85,6 @@ fn get_parameters(_: &Option<GenesisParameters>) -> CommonParameters {
}
}
/// Generate an authority keys.
pub
fn
get_authority_keys_from_seed
(
s
:
&
str
)
->
AuthorityKeys
{
(
get_account_id_from_seed
::
<
sr25519
::
Public
>
(
s
),
get_from_seed
::
<
GrandpaId
>
(
s
),
get_from_seed
::
<
BabeId
>
(
s
),
get_from_seed
::
<
ImOnlineId
>
(
s
),
get_from_seed
::
<
AuthorityDiscoveryId
>
(
s
),
)
}
/// Generate session keys
fn
get_session_keys_from_seed
(
s
:
&
str
)
->
SessionKeys
{
let
authority_keys
=
get_authority_keys_from_seed
(
s
);
session_keys
(
authority_keys
.1
,
authority_keys
.2
,
authority_keys
.3
,
authority_keys
.4
,
)
}
/// make session keys struct
fn
session_keys
(
grandpa
:
GrandpaId
,
babe
:
BabeId
,
im_online
:
ImOnlineId
,
authority_discovery
:
AuthorityDiscoveryId
,
)
->
SessionKeys
{
SessionKeys
{
grandpa
,
babe
,
im_online
,
authority_discovery
,
}
}
// === client specifications ===
/// emulate client specifications to get them from json
...
...
@@ -278,7 +234,7 @@ fn genesis_data_to_gtest_genesis_conf(
},
// Necessary to initialize TotalIssuence
balances
:
BalancesConfig
{
total_issuance
:
monetary_mass
,
total_issuance
:
initial_
monetary_mass
,
},
babe
:
BabeConfig
{
authorities
:
Vec
::
with_capacity
(
0
),
...
...
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