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
0ca5be22
Commit
0ca5be22
authored
1 year ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
add reproducibility
parent
de28baf2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
node/src/chain_spec/gtest_genesis.rs
+4
-5
4 additions, 5 deletions
node/src/chain_spec/gtest_genesis.rs
with
4 additions
and
5 deletions
node/src/chain_spec/gtest_genesis.rs
+
4
−
5
View file @
0ca5be22
...
@@ -116,9 +116,7 @@ pub fn build_genesis(
...
@@ -116,9 +116,7 @@ pub fn build_genesis(
// track if fatal error occured, but let processing continue
// track if fatal error occured, but let processing continue
let
mut
fatal
=
false
;
let
mut
fatal
=
false
;
// monetary mass for double check
// monetary mass for double check
let
mut
monetary_mass
=
0u64
;
// u128
let
mut
monetary_mass
=
0u64
;
// wallet index to generate random id
let
mut
wallet_index
:
u32
=
0
;
// counter for online authorities at genesis
// counter for online authorities at genesis
let
mut
counter_online_authorities
=
0
;
let
mut
counter_online_authorities
=
0
;
// track identity index
// track identity index
...
@@ -162,12 +160,11 @@ pub fn build_genesis(
...
@@ -162,12 +160,11 @@ pub fn build_genesis(
// double check the monetary mass
// double check the monetary mass
monetary_mass
+=
balance
;
monetary_mass
+=
balance
;
wallet_index
+=
1
;
// json prevents duplicate wallets
// json prevents duplicate wallets
accounts
.insert
(
accounts
.insert
(
pubkey
.clone
(),
pubkey
.clone
(),
GenesisAccountData
{
GenesisAccountData
{
random_id
:
H256
(
blake2_256
(
&
(
w
al
let_index
,
&
pubkey
)
.encode
())),
random_id
:
H256
(
blake2_256
(
&
(
b
al
ance
,
&
pubkey
)
.encode
())),
balance
:
*
balance
,
balance
:
*
balance
,
is_identity
:
false
,
is_identity
:
false
,
},
},
...
@@ -265,6 +262,8 @@ pub fn build_genesis(
...
@@ -265,6 +262,8 @@ pub fn build_genesis(
);
);
}
}
}
}
// sort the identities by index for reproducibility (should have been a vec in json)
identities
.sort_unstable_by
(|
a
,
b
|
(
a
.index
as
u32
)
.cmp
(
&
(
b
.index
as
u32
)));
// Technical Comittee //
// Technical Comittee //
// NOTE : when changing owner key, the technical committee is not changed
// NOTE : when changing owner key, the technical committee is not changed
...
...
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