Make Polkadot use the Substrate traity libraries (#105)

* Initial stuff.

* Various fixes.

* Fix tests.

* Fix another test

* Fix another test.

* Docs in polkadot runtime.

* Fix up ser/de tests.

* Update god keys

* Syntax

* Fix

* Merge remote-tracking branch 'origin/master' into gav-merge-runtime

* Permissions on init.sh

* Port-over the whitespace from @rphmeier

* Rename

* Merge branch 'master' into gav-merge-runtime

* Fix typo.

* Fix grumbles.

* Make more idiomatic.

* Move `Ed25519Signature` out of traits.
This commit is contained in:
Gav Wood
2018-04-05 17:13:12 +02:00
committed by Robert Habermeier
parent 6b83f11a11
commit 1d8a9a6dd3
60 changed files with 1335 additions and 3636 deletions
+1
View File
@@ -75,6 +75,7 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
let genesis_config = GenesisConfig {
consensus: Some(ConsensusConfig {
code: vec![], // TODO
authorities: vec![god_key.clone()],
}),
system: None,
+2 -2
View File
@@ -197,7 +197,7 @@ mod tests {
construct_block(
1,
[69u8; 32].into(),
hex!("4d58afeca0dec7604a0bcfb29573e6ad202efe65c8535b013c0c79b5a8c9114d").into(),
hex!("57ba67304318efaee95c4f9ab95ed5704eafe030bc8db2df00acb08c2f4979c8").into(),
vec![Extrinsic {
signed: Alice.into(),
index: 0,
@@ -210,7 +210,7 @@ mod tests {
construct_block(
2,
block1().1,
hex!("218ce7bdf2350713aa52dbf0a12d1e8b0a3a9f1623e7c95aa4800886e96397d1").into(),
hex!("ead4c60c0cad06b7ee73e64efeec2d4eb82c651469fb2ec748cfe5026bea5c49").into(),
vec![
Extrinsic {
signed: Bob.into(),
+1 -1
View File
@@ -49,4 +49,4 @@ pub type Index = u64;
pub type Hash = primitives::H256;
/// Alias to 512-bit hash when used in the context of a signature on the relay chain.
pub type Signature = runtime_primitives::traits::Ed25519Signature;
pub type Signature = runtime_primitives::Ed25519Signature;
+16 -15
View File
@@ -54,20 +54,6 @@ impl HasPublicAux for Concrete {
type PublicAux = AccountId;
}
impl timestamp::Trait for Concrete {
type Value = u64;
}
/// Timestamp module for this concrete runtime.
pub type Timestamp = timestamp::Module<Concrete>;
impl consensus::Trait for Concrete {
type SessionKey = SessionKey;
}
/// Consensus module for this concrete runtime.
pub type Consensus = consensus::Module<Concrete>;
impl system::Trait for Concrete {
type Index = Index;
type BlockNumber = BlockNumber;
@@ -81,8 +67,22 @@ impl system::Trait for Concrete {
/// System module for this concrete runtime.
pub type System = system::Module<Concrete>;
impl session::Trait for Concrete {
impl consensus::Trait for Concrete {
type PublicAux = <Self as HasPublicAux>::PublicAux;
type SessionKey = SessionKey;
}
/// Consensus module for this concrete runtime.
pub type Consensus = consensus::Module<Concrete>;
impl timestamp::Trait for Concrete {
type Value = u64;
}
/// Timestamp module for this concrete runtime.
pub type Timestamp = timestamp::Module<Concrete>;
impl session::Trait for Concrete {
type ConvertAccountIdToSessionKey = Identity;
}
@@ -113,6 +113,7 @@ pub type CouncilVoting = council::voting::Module<Concrete>;
impl_outer_dispatch! {
pub enum Call where aux: <Concrete as HasPublicAux>::PublicAux {
Consensus = 0,
Session = 1,
Staking = 2,
Timestamp = 3,
+5
View File
@@ -666,10 +666,12 @@ dependencies = [
"hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
"substrate-codec 0.1.0",
"substrate-primitives 0.1.0",
"substrate-runtime-io 0.1.0",
"substrate-runtime-primitives 0.1.0",
"substrate-runtime-std 0.1.0",
"substrate-runtime-support 0.1.0",
"substrate-runtime-system 0.1.0",
]
[[package]]
@@ -838,9 +840,12 @@ dependencies = [
"hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
"substrate-codec 0.1.0",
"substrate-primitives 0.1.0",
"substrate-runtime-io 0.1.0",
"substrate-runtime-primitives 0.1.0",
"substrate-runtime-std 0.1.0",
"substrate-runtime-support 0.1.0",
"substrate-runtime-system 0.1.0",
]
[[package]]
Binary file not shown.