Move Chain trait to runtime primitives (#403)

* extract ChainBase to bp-runtime

* post-merge fixes

* cargo fmt --all

* compilation fixes

* reexport BlockNumberOf, HashOf, HeaderOf
This commit is contained in:
Svyatoslav Nikolsky
2020-10-07 22:50:43 +03:00
committed by Bastian Köcher
parent ddeb59d336
commit 9e9ac8df3c
17 changed files with 238 additions and 171 deletions
+13
View File
@@ -20,6 +20,8 @@
// Runtime-generated DecodeLimit::decode_all_With_depth_limit
#![allow(clippy::unnecessary_mut_passed)]
use bp_runtime::Chain;
use frame_support::RuntimeDebug;
use sp_core::Hasher as HasherT;
use sp_runtime::traits::BlakeTwo256;
use sp_std::prelude::*;
@@ -36,6 +38,17 @@ pub type Hasher = BlakeTwo256;
/// The header type used by Millau.
pub type Header = sp_runtime::generic::Header<BlockNumber, Hasher>;
/// Millau chain.
#[derive(RuntimeDebug)]
pub struct Millau;
impl Chain for Millau {
type BlockNumber = BlockNumber;
type Hash = Hash;
type Hasher = Hasher;
type Header = Header;
}
sp_api::decl_runtime_apis! {
/// API for querying information about Millau headers from the Bridge Pallet instance.
///