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
+6 -2
View File
@@ -16,7 +16,7 @@
//! Types used to connect to the Millau-Substrate chain.
use relay_substrate_client::Chain;
use relay_substrate_client::{Chain, ChainBase};
use headers_relay::sync_types::SourceHeader;
use sp_runtime::traits::Header as HeaderT;
@@ -28,10 +28,14 @@ pub type HeaderId = relay_utils::HeaderId<millau_runtime::Hash, millau_runtime::
#[derive(Debug, Clone, Copy)]
pub struct Millau;
impl Chain for Millau {
impl ChainBase for Millau {
type BlockNumber = millau_runtime::BlockNumber;
type Hash = millau_runtime::Hash;
type Hasher = millau_runtime::Hashing;
type Header = millau_runtime::Header;
}
impl Chain for Millau {
type AccountId = millau_runtime::AccountId;
type Index = millau_runtime::Index;
type SignedBlock = millau_runtime::SignedBlock;