Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
dd5425a1
Unverified
Commit
dd5425a1
authored
Feb 03, 2021
by
Tomasz Drwięga
Browse files
Review grumbles.
parent
47b5896d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Cargo.lock
View file @
dd5425a1
This diff is collapsed.
Click to expand it.
node/service/src/chain_spec.rs
View file @
dd5425a1
...
...
@@ -1370,10 +1370,7 @@ pub fn rococo_testnet_genesis(
code
:
wasm_binary
.to_vec
(),
changes_trie_config
:
Default
::
default
(),
}),
pallet_beefy
:
Some
(
rococo_runtime
::
BeefyConfig
{
// TODO [ToDr] Beefy authorities
authorities
:
vec!
[],
}),
pallet_beefy
:
Some
(
Default
::
default
()),
pallet_indices
:
Some
(
rococo_runtime
::
IndicesConfig
{
indices
:
vec!
[],
}),
...
...
runtime/common/src/mmr.rs
View file @
dd5425a1
...
...
@@ -35,26 +35,6 @@ pub struct MmrLeaf<Hash, MerkleRoot> {
pub
beefy_next_authority_set
:
(
ValidatorSetId
,
MerkleRoot
),
}
impl
<
T
:
Config
>
LeafDataProvider
for
Module
<
T
>
where
MerkleRootOf
<
T
>
:
From
<
H256
>
,
{
type
LeafData
=
MmrLeaf
<
<
T
as
frame_system
::
Config
>
::
Hash
,
MerkleRootOf
<
T
>
,
>
;
fn
leaf_data
()
->
Self
::
LeafData
{
MmrLeaf
{
parent_hash
:
frame_system
::
Module
::
<
T
>
::
leaf_data
(),
parachain_heads
:
Module
::
<
T
>
::
parachain_heads_merkle_root
(),
beefy_next_authority_set
:
(
Module
::
<
T
>
::
beefy_next_authority_set_id
(),
Module
::
<
T
>
::
beefy_next_authority_set_merkle_root
()
),
}
}
}
type
MerkleRootOf
<
T
>
=
<
T
as
pallet_mmr
::
Config
>
::
Hash
;
/// The module's configuration trait.
...
...
@@ -66,13 +46,6 @@ pub trait Config: pallet_mmr::Config + paras::Config + pallet_beefy::Config
/// NOTE Remember that you still need to register the [Module] in `construct_runtime` macro.
impl
<
R
:
pallet_mmr
::
Config
+
paras
::
Config
+
pallet_beefy
::
Config
>
Config
for
R
{}
decl_error!
{
pub
enum
Error
for
Module
<
T
:
Config
>
{
/// No error
None
,
}
}
decl_storage!
{
trait
Store
for
Module
<
T
:
Config
>
as
Beefy
{
/// The merkle root of the next BEEFY authority set.
...
...
@@ -82,7 +55,26 @@ decl_storage! {
decl_module!
{
pub
struct
Module
<
T
:
Config
>
for
enum
Call
where
origin
:
<
T
as
frame_system
::
Config
>
::
Origin
{
type
Error
=
Error
<
T
>
;
}
}
impl
<
T
:
Config
>
LeafDataProvider
for
Module
<
T
>
where
MerkleRootOf
<
T
>
:
From
<
H256
>
,
{
type
LeafData
=
MmrLeaf
<
<
T
as
frame_system
::
Config
>
::
Hash
,
MerkleRootOf
<
T
>
,
>
;
fn
leaf_data
()
->
Self
::
LeafData
{
MmrLeaf
{
parent_hash
:
frame_system
::
Module
::
<
T
>
::
leaf_data
(),
parachain_heads
:
Module
::
<
T
>
::
parachain_heads_merkle_root
(),
beefy_next_authority_set
:
(
Module
::
<
T
>
::
beefy_next_authority_set_id
(),
Module
::
<
T
>
::
beefy_next_authority_set_merkle_root
()
),
}
}
}
...
...
runtime/rococo/Cargo.toml
View file @
dd5425a1
...
...
@@ -73,14 +73,14 @@ std = [
"pallet-authorship/std"
,
"pallet-babe/std"
,
"babe-primitives/std"
,
"beefy-primitives/std"
,
"beefy-primitives/std"
,
"pallet-balances/std"
,
"pallet-beefy/std"
,
"pallet-beefy/std"
,
"parity-scale-codec/std"
,
"frame-executive/std"
,
"pallet-grandpa/std"
,
"pallet-sudo/std"
,
"pallet-mmr/std"
,
"pallet-mmr/std"
,
"pallet-indices/std"
,
"pallet-im-online/std"
,
"inherents/std"
,
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment