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
b56b255c
Commit
b56b255c
authored
2 years ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
get values of parameters
parent
77a4185f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!168
gtest genesis new format
This commit is part of merge request
!171
. Comments created here will be created in the context of that merge request.
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
node/src/chain_spec/gtest_genesis.rs
+10
-9
10 additions, 9 deletions
node/src/chain_spec/gtest_genesis.rs
with
10 additions
and
9 deletions
node/src/chain_spec/gtest_genesis.rs
+
10
−
9
Edit
View file @
b56b255c
...
@@ -18,8 +18,8 @@ use common_runtime::constants::*;
...
@@ -18,8 +18,8 @@ use common_runtime::constants::*;
use
common_runtime
::
entities
::
IdtyData
;
use
common_runtime
::
entities
::
IdtyData
;
use
common_runtime
::
*
;
use
common_runtime
::
*
;
use
gtest_runtime
::{
use
gtest_runtime
::{
opaque
::
SessionKeys
,
AccountConfig
,
AccountId
,
AuthorityMembersConfig
,
BabeConfig
,
CertConfig
,
opaque
::
SessionKeys
,
parameters
,
AccountConfig
,
AccountId
,
AuthorityMembersConfig
,
BabeConfig
,
GenesisConfig
,
IdentityConfig
,
MembershipConfig
,
SessionConfig
,
SmithCertConfig
,
CertConfig
,
GenesisConfig
,
IdentityConfig
,
MembershipConfig
,
SessionConfig
,
SmithCertConfig
,
SmithMembershipConfig
,
SudoConfig
,
SystemConfig
,
TechnicalCommitteeConfig
,
SmithMembershipConfig
,
SudoConfig
,
SystemConfig
,
TechnicalCommitteeConfig
,
UniversalDividendConfig
,
UniversalDividendConfig
,
};
};
...
@@ -29,11 +29,12 @@ use std::collections::{BTreeMap, HashMap};
...
@@ -29,11 +29,12 @@ use std::collections::{BTreeMap, HashMap};
type
MembershipData
=
sp_membership
::
MembershipData
<
u32
>
;
type
MembershipData
=
sp_membership
::
MembershipData
<
u32
>
;
const
EXISTENTIAL_DEPOSIT
:
u64
=
200
;
// get values of parameters
const
MIN_CERT
:
u32
=
5
;
static
EXISTENTIAL_DEPOSIT
:
u64
=
parameters
::
ExistentialDeposit
::
get
();
const
SMITH_MIN_CERT
:
u32
=
5
;
static
SMITH_MEMBERSHIP_EXPIRE_ON
:
u32
=
parameters
::
SmithMembershipPeriod
::
get
();
const
GENESIS_SMITH_MEMBERSHIP_EXPIRE_ON
:
u32
=
1000000000
;
static
SMITH_CERTS_EXPIRE_ON
:
u32
=
parameters
::
SmithCertPeriod
::
get
();
const
GENESIS_SMITH_CERTS_EXPIRE_ON
:
u32
=
1000000000
;
static
MIN_CERT
:
u32
=
parameters
::
WotMinCertForMembership
::
get
();
static
SMITH_MIN_CERT
:
u32
=
parameters
::
SmithWotMinCertForMembership
::
get
();
// define structure of json
// define structure of json
#[derive(Clone,
Deserialize)]
#[derive(Clone,
Deserialize)]
...
@@ -361,7 +362,7 @@ pub fn build_genesis(
...
@@ -361,7 +362,7 @@ pub fn build_genesis(
.get
(
issuer
)
.get
(
issuer
)
.ok_or
(
format!
(
"Identity '{}' does not exist"
,
issuer
))
?
.ok_or
(
format!
(
"Identity '{}' does not exist"
,
issuer
))
?
.index
;
.index
;
certs
.insert
(
*
issuer_index
,
Some
(
GENESIS_
SMITH_CERTS_EXPIRE_ON
));
certs
.insert
(
*
issuer_index
,
Some
(
SMITH_CERTS_EXPIRE_ON
));
counter_smith_cert
+=
1
;
counter_smith_cert
+=
1
;
}
}
smith_certs_by_receiver
.insert
(
identity
.index
,
certs
);
smith_certs_by_receiver
.insert
(
identity
.index
,
certs
);
...
@@ -370,7 +371,7 @@ pub fn build_genesis(
...
@@ -370,7 +371,7 @@ pub fn build_genesis(
smith_memberships
.insert
(
smith_memberships
.insert
(
identity
.index
,
identity
.index
,
MembershipData
{
MembershipData
{
expire_on
:
GENESIS_
SMITH_MEMBERSHIP_EXPIRE_ON
,
expire_on
:
SMITH_MEMBERSHIP_EXPIRE_ON
,
},
},
);
);
}
else
{
}
else
{
...
...
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