mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 01:41:03 +00:00
Add BEEFY finality pallet with basic functionality (#1606)
* pallet-bridge-beefy: initial commit
This commit is contained in:
committed by
Bastian Köcher
parent
b3ab4a1b6a
commit
1f9110a065
@@ -10,6 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
bp-beefy = { path = "../beefy", default-features = false }
|
||||
bp-messages = { path = "../messages", default-features = false }
|
||||
bp-runtime = { path = "../runtime", default-features = false }
|
||||
fixed-hash = { version = "0.7.0", default-features = false }
|
||||
@@ -34,6 +35,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master",
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-beefy/std",
|
||||
"bp-messages/std",
|
||||
"bp-runtime/std",
|
||||
"fixed-hash/std",
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
mod millau_hash;
|
||||
|
||||
use bp_beefy::ChainWithBeefy;
|
||||
use bp_messages::{
|
||||
InboundMessageDetails, LaneId, MessageNonce, MessagePayload, OutboundMessageDetails,
|
||||
};
|
||||
@@ -41,6 +42,7 @@ use sp_trie::{LayoutV0, LayoutV1, TrieConfiguration};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sp_runtime::traits::Keccak256;
|
||||
|
||||
pub use millau_hash::MillauHash;
|
||||
|
||||
@@ -155,6 +157,16 @@ impl Chain for Millau {
|
||||
}
|
||||
}
|
||||
|
||||
impl ChainWithBeefy for Millau {
|
||||
type CommitmentHasher = Keccak256;
|
||||
type MmrHashing = Keccak256;
|
||||
type MmrHash = <Keccak256 as sp_runtime::traits::Hash>::Output;
|
||||
type BeefyMmrLeafExtra = ();
|
||||
type AuthorityId = bp_beefy::EcdsaValidatorId;
|
||||
type Signature = bp_beefy::EcdsaValidatorSignature;
|
||||
type AuthorityIdToMerkleLeaf = bp_beefy::BeefyEcdsaToEthereum;
|
||||
}
|
||||
|
||||
/// Millau Hasher (Blake2-256 ++ Keccak-256) implementation.
|
||||
#[derive(PartialEq, Eq, Clone, Copy, RuntimeDebug, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
|
||||
Reference in New Issue
Block a user