Unverified Commit dd5425a1 authored by Tomasz Drwięga's avatar Tomasz Drwięga
Browse files

Review grumbles.

parent 47b5896d
This diff is collapsed.
......@@ -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![],
}),
......
......@@ -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()
),
}
}
}
......
......@@ -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",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment