-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from hammeWang/develop
Develop
- Loading branch information
Showing
8 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "darwinia-chainrelay" | ||
version = "0.1.0" | ||
authors = ["hammeWang <dsw0602@foxmail.com>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
rstd = { package = "sr-std", git = 'https://github.com/paritytech/substrate.git', default-features = false } | ||
support = { package = "srml-support", git = 'https://github.com/paritytech/substrate.git', default-features = false } | ||
system = { package = "srml-system", git = 'https://github.com/paritytech/substrate.git', default-features = false } | ||
poa = { package = "darwinia-chainrelay-poa", path = "../chainrelay/poa", default-features = false } | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"rstd/std", | ||
"support/std", | ||
"system/std", | ||
"poa/std", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "darwinia-chainrelay-poa" | ||
version = "0.1.0" | ||
authors = ["hammeWang <dsw0602@foxmail.com>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
|
||
|
||
[features] | ||
default = ["std"] | ||
std = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pub struct BestHeader<Hash> { | ||
height: u64, // enough for ethereum poa network (kovan) | ||
hash: Hash, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! prototype module for bridging in ethereum poa blockcahin | ||
#![recursion_limit = "128"] | ||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
use rstd::prelude::*; | ||
use support::{decl_event, decl_module, decl_storage, ensure}; | ||
|
||
use poa::BestHeader; | ||
|
||
pub trait Trait: system::Trait {} | ||
|
||
decl_storage! { | ||
trait Store for Module<T: Trait> as Bridge { | ||
// we don't need to start from genesis block | ||
pub InitialBlock get(initial_block) config(): T::BlockNumber; | ||
// BestHeader | ||
pub BestHeader get(best_header): BestHeader; | ||
|
||
} | ||
} |