Substrate relay stub (#376)

* substrate-relay: initial commit

* MillauHeaderApi and RialtoHeaderApi

* post-merge fixes + TODOs + compilation
This commit is contained in:
Svyatoslav Nikolsky
2020-09-30 14:03:57 +03:00
committed by Bastian Köcher
parent f9db999a1a
commit dbb72faa86
22 changed files with 652 additions and 71 deletions
+2
View File
@@ -8,6 +8,7 @@ repository = "https://github.com/paritytech/parity-bridges-common/"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
bp-millau = { path = "../../primitives/millau", default-features = false }
hex-literal = "0.3"
[dependencies.codec]
@@ -217,6 +218,7 @@ git = "https://github.com/paritytech/substrate/"
default = ["std"]
std = [
"bp-message-lane/std",
"bp-millau/std",
"codec/std",
"frame-benchmarking/std",
"frame-executive/std",
+2 -2
View File
@@ -61,7 +61,7 @@ pub use sp_runtime::BuildStorage;
pub use sp_runtime::{Perbill, Permill};
/// An index to a block.
pub type BlockNumber = u32;
pub type BlockNumber = bp_millau::BlockNumber;
/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.
pub type Signature = MultiSignature;
@@ -81,7 +81,7 @@ pub type Balance = u128;
pub type Index = u32;
/// A hash of some data used by the chain.
pub type Hash = sp_core::H256;
pub type Hash = bp_millau::Hash;
/// Digest item type.
pub type DigestItem = generic::DigestItem<Hash>;
+4
View File
@@ -8,6 +8,8 @@ repository = "https://github.com/paritytech/parity-bridges-common/"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
bp-millau = { path = "../../primitives/millau", default-features = false }
bp-rialto = { path = "../../primitives/rialto", default-features = false }
hex-literal = "0.3"
[dependencies.codec]
@@ -256,6 +258,8 @@ std = [
"bp-currency-exchange/std",
"bp-eth-poa/std",
"bp-message-lane/std",
"bp-millau/std",
"bp-rialto/std",
"codec/std",
"frame-benchmarking/std",
"frame-executive/std",
+19 -2
View File
@@ -70,7 +70,7 @@ pub use sp_runtime::BuildStorage;
pub use sp_runtime::{Perbill, Permill};
/// An index to a block.
pub type BlockNumber = u32;
pub type BlockNumber = bp_rialto::BlockNumber;
/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.
pub type Signature = MultiSignature;
@@ -90,7 +90,7 @@ pub type Balance = u128;
pub type Index = u32;
/// A hash of some data used by the chain.
pub type Hash = sp_core::H256;
pub type Hash = bp_rialto::Hash;
/// Digest item type.
pub type DigestItem = generic::DigestItem<Hash>;
@@ -574,6 +574,23 @@ impl_runtime_apis! {
}
}
impl bp_millau::MillauHeaderApi<Block> for Runtime {
fn best_block() -> (bp_millau::BlockNumber, bp_millau::Hash) {
unimplemented!("https://github.com/paritytech/parity-bridges-common/issues/368")
}
fn finalized_block() -> (bp_millau::BlockNumber, bp_millau::Hash) {
unimplemented!("https://github.com/paritytech/parity-bridges-common/issues/368")
}
fn incomplete_headers() -> Vec<(bp_millau::BlockNumber, bp_millau::Hash)> {
unimplemented!("https://github.com/paritytech/parity-bridges-common/issues/368")
}
fn is_known_block(_hash: bp_millau::Hash) -> bool {
unimplemented!("https://github.com/paritytech/parity-bridges-common/issues/368")
}
}
impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
fn validate_transaction(