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
85d5570e
Commit
85d5570e
authored
1 year ago
by
crystalin
Browse files
Options
Downloads
Patches
Plain Diff
Changes genesis to use blake2hash for wasm hash
parent
5c038e0f
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/client/chain-spec/src/genesis.rs
+10
-6
10 additions, 6 deletions
substrate/client/chain-spec/src/genesis.rs
with
10 additions
and
6 deletions
substrate/client/chain-spec/src/genesis.rs
+
10
−
6
View file @
85d5570e
...
...
@@ -18,11 +18,17 @@
//! Tool for creating the genesis block.
use
std
::{
collections
::
hash_map
::
DefaultHasher
,
marker
::
PhantomData
,
sync
::
Arc
};
use
std
::{
marker
::
PhantomData
,
sync
::
Arc
};
use
sc_client_api
::{
backend
::
Backend
,
BlockImportOperation
};
use
sc_executor
::
RuntimeVersionOf
;
use
sp_core
::
storage
::{
well_known_keys
,
StateVersion
,
Storage
};
use
sp_core
::{
storage
::{
well_known_keys
,
StateVersion
,
Storage
},
Blake2Hasher
};
use
sp_runtime
::{
traits
::{
Block
as
BlockT
,
Hash
as
HashT
,
Header
as
HeaderT
,
Zero
},
BuildStorage
,
...
...
@@ -44,10 +50,8 @@ where
code_fetcher
:
&
code_fetcher
,
heap_pages
:
None
,
hash
:
{
use
std
::
hash
::{
Hash
,
Hasher
};
let
mut
state
=
DefaultHasher
::
new
();
wasm
.hash
(
&
mut
state
);
state
.finish
()
.to_le_bytes
()
.to_vec
()
use
sp_core
::
Hasher
;
Blake2Hasher
::
hash
(
&
wasm
.to_vec
())
.as_ref
()
.to_vec
()
},
};
let
runtime_version
=
RuntimeVersionOf
::
runtime_version
(
executor
,
&
mut
ext
,
&
runtime_code
)
...
...
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