mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 22:45:40 +00:00
Fix up polkadot runtime
This commit is contained in:
Generated
+366
-336
File diff suppressed because it is too large
Load Diff
@@ -8,14 +8,14 @@ error-chain = "0.12"
|
|||||||
polkadot-executor = { path = "../executor" }
|
polkadot-executor = { path = "../executor" }
|
||||||
polkadot-runtime = { path = "../runtime" }
|
polkadot-runtime = { path = "../runtime" }
|
||||||
polkadot-primitives = { path = "../primitives" }
|
polkadot-primitives = { path = "../primitives" }
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-io = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-executive = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-client = { git = "https://github.com/paritytech/substrate" }
|
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-executor = { git = "https://github.com/paritytech/substrate" }
|
substrate-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-state-machine = { git = "https://github.com/paritytech/substrate" }
|
substrate-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
substrate-keyring = { git = "https://github.com/paritytech/substrate" }
|
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ impl<B: LocalBackend<Block, KeccakHasher, RlpCodec>> PolkadotApi for Client<B, L
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn lookup(&self, at: &BlockId, address: Address) -> Result<Option<AccountId>> {
|
fn lookup(&self, at: &BlockId, address: Address) -> Result<Option<AccountId>> {
|
||||||
with_runtime!(self, at, || <::runtime::Staking as AuxLookup>::lookup(address).ok())
|
with_runtime!(self, at, || <::runtime::Balances as AuxLookup>::lookup(address).ok())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn active_parachains(&self, at: &BlockId) -> Result<Vec<ParaId>> {
|
fn active_parachains(&self, at: &BlockId) -> Result<Vec<ParaId>> {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
|||||||
polkadot-primitives = { path = "../primitives" }
|
polkadot-primitives = { path = "../primitives" }
|
||||||
parking_lot = "0.4"
|
parking_lot = "0.4"
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
kvdb = { git = "https://github.com/paritytech/parity-common.git" }
|
kvdb = { git = "https://github.com/paritytech/parity-common.git" }
|
||||||
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common.git" }
|
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common.git" }
|
||||||
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common.git" }
|
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common.git" }
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ log = "0.3"
|
|||||||
tokio = "0.1.7"
|
tokio = "0.1.7"
|
||||||
futures = "0.1.17"
|
futures = "0.1.17"
|
||||||
exit-future = "0.1"
|
exit-future = "0.1"
|
||||||
substrate-cli = { git = "https://github.com/paritytech/substrate" }
|
substrate-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
polkadot-service = { path = "../service" }
|
polkadot-service = { path = "../service" }
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ description = "Collator node implementation"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = "0.1.17"
|
futures = "0.1.17"
|
||||||
substrate-client = { git = "https://github.com/paritytech/substrate" }
|
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate", version = "0.1" }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate", version = "0.1" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
polkadot-api = { path = "../api" }
|
polkadot-api = { path = "../api" }
|
||||||
polkadot-runtime = { path = "../runtime", version = "0.1" }
|
polkadot-runtime = { path = "../runtime", version = "0.1" }
|
||||||
polkadot-primitives = { path = "../primitives", version = "0.1" }
|
polkadot-primitives = { path = "../primitives", version = "0.1" }
|
||||||
polkadot-cli = { path = "../cli" }
|
polkadot-cli = { path = "../cli" }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
ed25519 = { git = "https://github.com/paritytech/substrate" }
|
ed25519 = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
tokio = "0.1.7"
|
tokio = "0.1.7"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
|||||||
futures = "0.1.17"
|
futures = "0.1.17"
|
||||||
parking_lot = "0.4"
|
parking_lot = "0.4"
|
||||||
tokio = "0.1.7"
|
tokio = "0.1.7"
|
||||||
ed25519 = { git = "https://github.com/paritytech/substrate" }
|
ed25519 = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
error-chain = "0.12"
|
error-chain = "0.12"
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
exit-future = "0.1"
|
exit-future = "0.1"
|
||||||
@@ -19,12 +19,12 @@ polkadot-primitives = { path = "../primitives" }
|
|||||||
polkadot-runtime = { path = "../runtime" }
|
polkadot-runtime = { path = "../runtime" }
|
||||||
polkadot-statement-table = { path = "../statement-table" }
|
polkadot-statement-table = { path = "../statement-table" }
|
||||||
polkadot-transaction-pool = { path = "../transaction-pool" }
|
polkadot-transaction-pool = { path = "../transaction-pool" }
|
||||||
substrate-bft = { git = "https://github.com/paritytech/substrate" }
|
substrate-bft = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-support = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-client = { git = "https://github.com/paritytech/substrate" }
|
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
substrate-keyring = { git = "https://github.com/paritytech/substrate" }
|
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
|
|||||||
@@ -549,8 +549,8 @@ impl<C> bft::Proposer<Block> for Proposer<C>
|
|||||||
|
|
||||||
// refuse to vote if this block says a validator is offline that we
|
// refuse to vote if this block says a validator is offline that we
|
||||||
// think isn't.
|
// think isn't.
|
||||||
let offline = proposal.noted_offline();
|
let missed_proposal = proposal.noted_missed_proposal();
|
||||||
if !self.offline.read().check_consistency(&self.validators[..], offline) {
|
if !self.offline.read().check_consistency(&self.validators[..], missed_proposal) {
|
||||||
return Box::new(futures::empty());
|
return Box::new(futures::empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ impl Service {
|
|||||||
let mut prev_best = match client.best_block_header() {
|
let mut prev_best = match client.best_block_header() {
|
||||||
Ok(header) => header.hash(),
|
Ok(header) => header.hash(),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("Cant's start consensus service. Error reading best block header: {:?}", e);
|
warn!("Can't start consensus service. Error reading best block header: {:?}", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
|||||||
description = "Polkadot node implementation in Rust."
|
description = "Polkadot node implementation in Rust."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
substrate-executor = { git = "https://github.com/paritytech/substrate" }
|
substrate-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
polkadot-runtime = { path = "../runtime" }
|
polkadot-runtime = { path = "../runtime" }
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ polkadot-api = { path = "../api" }
|
|||||||
polkadot-availability-store = { path = "../availability-store" }
|
polkadot-availability-store = { path = "../availability-store" }
|
||||||
polkadot-consensus = { path = "../consensus" }
|
polkadot-consensus = { path = "../consensus" }
|
||||||
polkadot-primitives = { path = "../primitives" }
|
polkadot-primitives = { path = "../primitives" }
|
||||||
substrate-bft = { git = "https://github.com/paritytech/substrate" }
|
substrate-bft = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-codec-derive = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-network = { git = "https://github.com/paritytech/substrate" }
|
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
ed25519 = { git = "https://github.com/paritytech/substrate" }
|
ed25519 = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
futures = "0.1"
|
futures = "0.1"
|
||||||
tokio = "0.1.7"
|
tokio = "0.1.7"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
|||||||
description = "Types and utilities for creating and working with parachains"
|
description = "Types and utilities for creating and working with parachains"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
wasmi = { version = "0.4", optional = true }
|
wasmi = { version = "0.4", optional = true }
|
||||||
error-chain = { version = "0.12", optional = true }
|
error-chain = { version = "0.12", optional = true }
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0", default_features = false }
|
serde = { version = "1.0", default_features = false }
|
||||||
serde_derive = { version = "1.0", optional = true }
|
serde_derive = { version = "1.0", optional = true }
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate", default_features = false }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default_features = false }
|
||||||
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", default_features = false }
|
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default_features = false }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate", default_features = false }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default_features = false }
|
||||||
substrate-runtime-std = { git = "https://github.com/paritytech/substrate", default_features = false }
|
substrate-runtime-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default_features = false }
|
||||||
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate", default_features = false }
|
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default_features = false }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
substrate-serializer = { git = "https://github.com/paritytech/substrate" }
|
substrate-serializer = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
pretty_assertions = "0.4"
|
pretty_assertions = "0.4"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
+21
-17
@@ -10,23 +10,25 @@ serde = { version = "1.0", default_features = false }
|
|||||||
serde_derive = { version = "1.0", optional = true }
|
serde_derive = { version = "1.0", optional = true }
|
||||||
safe-mix = { version = "1.0", default_features = false}
|
safe-mix = { version = "1.0", default_features = false}
|
||||||
polkadot-primitives = { path = "../primitives", default_features = false }
|
polkadot-primitives = { path = "../primitives", default_features = false }
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-serializer = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-std = { git = "https://github.com/paritytech/substrate" }
|
substrate-serializer = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-io = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-support = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-keyring = { git = "https://github.com/paritytech/substrate" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-consensus = { git = "https://github.com/paritytech/substrate" }
|
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-council = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-democracy = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-executive = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-council = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-session = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-staking = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-system = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-timestamp = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-version = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
|
substrate-runtime-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
|
substrate-runtime-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
hex-literal = "0.1.0"
|
hex-literal = "0.1.0"
|
||||||
@@ -36,10 +38,12 @@ default = ["std"]
|
|||||||
std = [
|
std = [
|
||||||
"polkadot-primitives/std",
|
"polkadot-primitives/std",
|
||||||
"substrate-codec/std",
|
"substrate-codec/std",
|
||||||
|
"substrate-codec-derive/std",
|
||||||
"substrate-primitives/std",
|
"substrate-primitives/std",
|
||||||
"substrate-runtime-std/std",
|
"substrate-runtime-std/std",
|
||||||
"substrate-runtime-io/std",
|
"substrate-runtime-io/std",
|
||||||
"substrate-runtime-support/std",
|
"substrate-runtime-support/std",
|
||||||
|
"substrate-runtime-balances/std",
|
||||||
"substrate-runtime-consensus/std",
|
"substrate-runtime-consensus/std",
|
||||||
"substrate-runtime-council/std",
|
"substrate-runtime-council/std",
|
||||||
"substrate-runtime-democracy/std",
|
"substrate-runtime-democracy/std",
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
//! Typesafe block interaction.
|
//! Typesafe block interaction.
|
||||||
|
|
||||||
use super::{Call, Block, TIMESTAMP_SET_POSITION, PARACHAINS_SET_POSITION, NOTE_OFFLINE_POSITION};
|
use super::{Call, Block, TIMESTAMP_SET_POSITION, PARACHAINS_SET_POSITION, NOTE_MISSED_PROPOSAL_POSITION};
|
||||||
use timestamp::Call as TimestampCall;
|
use timestamp::Call as TimestampCall;
|
||||||
use parachains::Call as ParachainsCall;
|
use parachains::Call as ParachainsCall;
|
||||||
use session::Call as SessionCall;
|
use staking::Call as StakingCall;
|
||||||
use primitives::parachain::CandidateReceipt;
|
use primitives::parachain::CandidateReceipt;
|
||||||
|
|
||||||
/// Provides a type-safe wrapper around a structurally valid block.
|
/// Provides a type-safe wrapper around a structurally valid block.
|
||||||
@@ -90,10 +90,10 @@ impl CheckedBlock {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extract the noted offline validator indices (if any) from the block.
|
/// Extract the noted missed proposal validator indices (if any) from the block.
|
||||||
pub fn noted_offline(&self) -> &[u32] {
|
pub fn noted_missed_proposal(&self) -> &[u32] {
|
||||||
self.inner.extrinsics.get(NOTE_OFFLINE_POSITION as usize).and_then(|xt| match xt.extrinsic.function {
|
self.inner.extrinsics.get(NOTE_MISSED_PROPOSAL_POSITION as usize).and_then(|xt| match xt.extrinsic.function {
|
||||||
Call::Session(SessionCall::note_offline(ref x)) => Some(&x[..]),
|
Call::Staking(StakingCall::note_missed_proposal(ref x)) => Some(&x[..]),
|
||||||
_ => None,
|
_ => None,
|
||||||
}).unwrap_or(&[])
|
}).unwrap_or(&[])
|
||||||
}
|
}
|
||||||
|
|||||||
+36
-14
@@ -45,9 +45,12 @@ extern crate substrate_primitives;
|
|||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate substrate_runtime_std as rstd;
|
extern crate substrate_runtime_std as rstd;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate substrate_codec_derive;
|
||||||
|
|
||||||
extern crate polkadot_primitives as primitives;
|
extern crate polkadot_primitives as primitives;
|
||||||
extern crate substrate_codec as codec;
|
extern crate substrate_codec as codec;
|
||||||
|
extern crate substrate_runtime_balances as balances;
|
||||||
extern crate substrate_runtime_consensus as consensus;
|
extern crate substrate_runtime_consensus as consensus;
|
||||||
extern crate substrate_runtime_council as council;
|
extern crate substrate_runtime_council as council;
|
||||||
extern crate substrate_runtime_democracy as democracy;
|
extern crate substrate_runtime_democracy as democracy;
|
||||||
@@ -67,7 +70,7 @@ mod utils;
|
|||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
pub use checked_block::CheckedBlock;
|
pub use checked_block::CheckedBlock;
|
||||||
pub use utils::{inherent_extrinsics, check_extrinsic};
|
pub use utils::{inherent_extrinsics, check_extrinsic};
|
||||||
pub use staking::address::Address as RawAddress;
|
pub use balances::address::Address as RawAddress;
|
||||||
|
|
||||||
use primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, Log, SessionKey, Signature};
|
use primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, Log, SessionKey, Signature};
|
||||||
use runtime_primitives::{generic, traits::{HasPublicAux, BlakeTwo256, Convert}};
|
use runtime_primitives::{generic, traits::{HasPublicAux, BlakeTwo256, Convert}};
|
||||||
@@ -85,11 +88,11 @@ pub use primitives::Header;
|
|||||||
pub const TIMESTAMP_SET_POSITION: u32 = 0;
|
pub const TIMESTAMP_SET_POSITION: u32 = 0;
|
||||||
/// The position of the parachains set extrinsic.
|
/// The position of the parachains set extrinsic.
|
||||||
pub const PARACHAINS_SET_POSITION: u32 = 1;
|
pub const PARACHAINS_SET_POSITION: u32 = 1;
|
||||||
/// The position of the offline nodes noting extrinsic.
|
/// The position of the note_missed_proposal extrinsic in the block, if it exists.
|
||||||
pub const NOTE_OFFLINE_POSITION: u32 = 2;
|
pub const NOTE_MISSED_PROPOSAL_POSITION: u32 = 2;
|
||||||
|
|
||||||
/// The address format for describing accounts.
|
/// The address format for describing accounts.
|
||||||
pub type Address = staking::Address<Concrete>;
|
pub type Address = balances::Address<Concrete>;
|
||||||
/// Block Id type for this block.
|
/// Block Id type for this block.
|
||||||
pub type BlockId = generic::BlockId<Block>;
|
pub type BlockId = generic::BlockId<Block>;
|
||||||
/// Unchecked extrinsic type as expected by this runtime.
|
/// Unchecked extrinsic type as expected by this runtime.
|
||||||
@@ -136,10 +139,21 @@ impl system::Trait for Concrete {
|
|||||||
type Digest = generic::Digest<Log>;
|
type Digest = generic::Digest<Log>;
|
||||||
type AccountId = AccountId;
|
type AccountId = AccountId;
|
||||||
type Header = Header;
|
type Header = Header;
|
||||||
|
type Event = Event;
|
||||||
}
|
}
|
||||||
/// System module for this concrete runtime.
|
/// System module for this concrete runtime.
|
||||||
pub type System = system::Module<Concrete>;
|
pub type System = system::Module<Concrete>;
|
||||||
|
|
||||||
|
impl balances::Trait for Concrete {
|
||||||
|
type Balance = Balance;
|
||||||
|
type AccountIndex = AccountIndex;
|
||||||
|
type OnFreeBalanceZero = Staking;
|
||||||
|
type IsAccountLiquid = Staking;
|
||||||
|
type Event = Event;
|
||||||
|
}
|
||||||
|
/// Staking module for this concrete runtime.
|
||||||
|
pub type Balances = balances::Module<Concrete>;
|
||||||
|
|
||||||
impl consensus::Trait for Concrete {
|
impl consensus::Trait for Concrete {
|
||||||
type SessionKey = SessionKey;
|
type SessionKey = SessionKey;
|
||||||
}
|
}
|
||||||
@@ -162,17 +176,16 @@ impl Convert<AccountId, SessionKey> for SessionKeyConversion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl session::Trait for Concrete {
|
impl session::Trait for Concrete {
|
||||||
const NOTE_OFFLINE_POSITION: u32 = NOTE_OFFLINE_POSITION;
|
|
||||||
type ConvertAccountIdToSessionKey = SessionKeyConversion;
|
type ConvertAccountIdToSessionKey = SessionKeyConversion;
|
||||||
type OnSessionChange = Staking;
|
type OnSessionChange = Staking;
|
||||||
|
type Event = Event;
|
||||||
}
|
}
|
||||||
/// Session module for this concrete runtime.
|
/// Session module for this concrete runtime.
|
||||||
pub type Session = session::Module<Concrete>;
|
pub type Session = session::Module<Concrete>;
|
||||||
|
|
||||||
impl staking::Trait for Concrete {
|
impl staking::Trait for Concrete {
|
||||||
type Balance = Balance;
|
const NOTE_MISSED_PROPOSAL_POSITION: u32 = NOTE_MISSED_PROPOSAL_POSITION;
|
||||||
type AccountIndex = AccountIndex;
|
type Event = Event;
|
||||||
type OnAccountKill = ();
|
|
||||||
}
|
}
|
||||||
/// Staking module for this concrete runtime.
|
/// Staking module for this concrete runtime.
|
||||||
pub type Staking = staking::Module<Concrete>;
|
pub type Staking = staking::Module<Concrete>;
|
||||||
@@ -196,15 +209,22 @@ impl parachains::Trait for Concrete {
|
|||||||
}
|
}
|
||||||
pub type Parachains = parachains::Module<Concrete>;
|
pub type Parachains = parachains::Module<Concrete>;
|
||||||
|
|
||||||
|
impl_outer_event! {
|
||||||
|
pub enum Event for Concrete {
|
||||||
|
balances, session, staking
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl_outer_dispatch! {
|
impl_outer_dispatch! {
|
||||||
/// Call type for polkadot transactions.
|
/// Call type for polkadot transactions.
|
||||||
#[derive(Clone, PartialEq, Eq)]
|
#[derive(Clone, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
|
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
|
||||||
pub enum Call where aux: <Concrete as HasPublicAux>::PublicAux {
|
pub enum Call where aux: <Concrete as HasPublicAux>::PublicAux {
|
||||||
Consensus = 0,
|
Consensus = 0,
|
||||||
Session = 1,
|
Balances = 1,
|
||||||
Staking = 2,
|
Session = 2,
|
||||||
Timestamp = 3,
|
Staking = 3,
|
||||||
|
Timestamp = 4,
|
||||||
Democracy = 5,
|
Democracy = 5,
|
||||||
Council = 6,
|
Council = 6,
|
||||||
CouncilVoting = 7,
|
CouncilVoting = 7,
|
||||||
@@ -216,8 +236,9 @@ impl_outer_dispatch! {
|
|||||||
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
|
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
|
||||||
pub enum PrivCall {
|
pub enum PrivCall {
|
||||||
Consensus = 0,
|
Consensus = 0,
|
||||||
Session = 1,
|
Balances = 1,
|
||||||
Staking = 2,
|
Session = 2,
|
||||||
|
Staking = 3,
|
||||||
Democracy = 5,
|
Democracy = 5,
|
||||||
Council = 6,
|
Council = 6,
|
||||||
CouncilVoting = 7,
|
CouncilVoting = 7,
|
||||||
@@ -226,13 +247,14 @@ impl_outer_dispatch! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Executive: handles dispatch to the various modules.
|
/// Executive: handles dispatch to the various modules.
|
||||||
pub type Executive = executive::Executive<Concrete, Block, Staking, Staking,
|
pub type Executive = executive::Executive<Concrete, Block, Balances, Balances,
|
||||||
(((((((), Parachains), Council), Democracy), Staking), Session), Timestamp)>;
|
(((((((), Parachains), Council), Democracy), Staking), Session), Timestamp)>;
|
||||||
|
|
||||||
impl_outer_config! {
|
impl_outer_config! {
|
||||||
pub struct GenesisConfig for Concrete {
|
pub struct GenesisConfig for Concrete {
|
||||||
ConsensusConfig => consensus,
|
ConsensusConfig => consensus,
|
||||||
SystemConfig => system,
|
SystemConfig => system,
|
||||||
|
BaalncesConfig => balances,
|
||||||
SessionConfig => session,
|
SessionConfig => session,
|
||||||
StakingConfig => staking,
|
StakingConfig => staking,
|
||||||
DemocracyConfig => democracy,
|
DemocracyConfig => democracy,
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ impl<T: Trait> Module<T> {
|
|||||||
ensure!(aux.is_empty(), "set_heads must not be signed");
|
ensure!(aux.is_empty(), "set_heads must not be signed");
|
||||||
ensure!(!<DidUpdate<T>>::exists(), "Parachain heads must be updated only once in the block");
|
ensure!(!<DidUpdate<T>>::exists(), "Parachain heads must be updated only once in the block");
|
||||||
ensure!(
|
ensure!(
|
||||||
<system::Module<T>>::extrinsic_index() == T::SET_POSITION,
|
<system::Module<T>>::extrinsic_index() == Some(T::SET_POSITION),
|
||||||
"Parachain heads update extrinsic must be at position {} in the block"
|
"Parachain heads update extrinsic must be at position {} in the block"
|
||||||
// , T::SET_POSITION
|
// , T::SET_POSITION
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,11 +17,11 @@
|
|||||||
//! Utils for block interaction.
|
//! Utils for block interaction.
|
||||||
|
|
||||||
use rstd::prelude::*;
|
use rstd::prelude::*;
|
||||||
use super::{Call, UncheckedExtrinsic, Extrinsic, Staking};
|
use super::{Call, UncheckedExtrinsic, Extrinsic, Balances};
|
||||||
use runtime_primitives::traits::{Checkable, AuxLookup};
|
use runtime_primitives::traits::{Checkable, AuxLookup};
|
||||||
use timestamp::Call as TimestampCall;
|
use timestamp::Call as TimestampCall;
|
||||||
use parachains::Call as ParachainsCall;
|
use parachains::Call as ParachainsCall;
|
||||||
use session::Call as SessionCall;
|
use staking::Call as StakingCall;
|
||||||
|
|
||||||
/// Produces the list of inherent extrinsics.
|
/// Produces the list of inherent extrinsics.
|
||||||
pub fn inherent_extrinsics(data: ::primitives::InherentData) -> Vec<UncheckedExtrinsic> {
|
pub fn inherent_extrinsics(data: ::primitives::InherentData) -> Vec<UncheckedExtrinsic> {
|
||||||
@@ -41,7 +41,7 @@ pub fn inherent_extrinsics(data: ::primitives::InherentData) -> Vec<UncheckedExt
|
|||||||
|
|
||||||
if !data.offline_indices.is_empty() {
|
if !data.offline_indices.is_empty() {
|
||||||
inherent.push(make_inherent(
|
inherent.push(make_inherent(
|
||||||
Call::Session(SessionCall::note_offline(data.offline_indices))
|
Call::Staking(StakingCall::note_missed_proposal(data.offline_indices))
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,5 +50,5 @@ pub fn inherent_extrinsics(data: ::primitives::InherentData) -> Vec<UncheckedExt
|
|||||||
|
|
||||||
/// Checks an unchecked extrinsic for validity.
|
/// Checks an unchecked extrinsic for validity.
|
||||||
pub fn check_extrinsic(xt: UncheckedExtrinsic) -> bool {
|
pub fn check_extrinsic(xt: UncheckedExtrinsic) -> bool {
|
||||||
xt.check_with(Staking::lookup).is_ok()
|
xt.check_with(Balances::lookup).is_ok()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,21 +10,21 @@ crate-type = ["cdylib"]
|
|||||||
integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", branch = "master" }
|
integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", branch = "master" }
|
||||||
polkadot-primitives = { path = "../../primitives", default-features = false }
|
polkadot-primitives = { path = "../../primitives", default-features = false }
|
||||||
safe-mix = { version = "1.0", default-features = false }
|
safe-mix = { version = "1.0", default-features = false }
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-std = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-io = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-support = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-consensus = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-council = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-council = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-democracy = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-executive = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-session = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-staking = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-system = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
substrate-runtime-version = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-runtime-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ log = "0.3"
|
|||||||
slog = "^2"
|
slog = "^2"
|
||||||
tokio = "0.1.7"
|
tokio = "0.1.7"
|
||||||
hex-literal = "0.1"
|
hex-literal = "0.1"
|
||||||
ed25519 = { git = "https://github.com/paritytech/substrate" }
|
ed25519 = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
polkadot-availability-store = { path = "../availability-store" }
|
polkadot-availability-store = { path = "../availability-store" }
|
||||||
polkadot-primitives = { path = "../primitives" }
|
polkadot-primitives = { path = "../primitives" }
|
||||||
polkadot-runtime = { path = "../runtime" }
|
polkadot-runtime = { path = "../runtime" }
|
||||||
@@ -20,9 +20,9 @@ polkadot-executor = { path = "../executor" }
|
|||||||
polkadot-api = { path = "../api" }
|
polkadot-api = { path = "../api" }
|
||||||
polkadot-transaction-pool = { path = "../transaction-pool" }
|
polkadot-transaction-pool = { path = "../transaction-pool" }
|
||||||
polkadot-network = { path = "../network" }
|
polkadot-network = { path = "../network" }
|
||||||
substrate-runtime-io = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-network = { git = "https://github.com/paritytech/substrate" }
|
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-client = { git = "https://github.com/paritytech/substrate" }
|
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-service = { git = "https://github.com/paritytech/substrate" }
|
substrate-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-telemetry = { git = "https://github.com/paritytech/substrate" }
|
substrate-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
|||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-codec-derive = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
polkadot-primitives = { path = "../primitives" }
|
polkadot-primitives = { path = "../primitives" }
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ description = "Test parachain which adds to a number as its state transition"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
polkadot-parachain = { path = "../../parachain/", default-features = false }
|
polkadot-parachain = { path = "../../parachain/", default-features = false }
|
||||||
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", default-features = false }
|
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", branch = "polkadot", default-features = false }
|
||||||
tiny-keccak = "1.4"
|
tiny-keccak = "1.4"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ adder = { path = ".." }
|
|||||||
polkadot-parachain = { path = "../../../parachain" }
|
polkadot-parachain = { path = "../../../parachain" }
|
||||||
polkadot-collator = { path = "../../../collator" }
|
polkadot-collator = { path = "../../../collator" }
|
||||||
polkadot-primitives = { path = "../../../primitives" }
|
polkadot-primitives = { path = "../../../primitives" }
|
||||||
ed25519 = { git = "https://github.com/paritytech/substrate" }
|
ed25519 = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
parking_lot = "0.4"
|
parking_lot = "0.4"
|
||||||
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
|
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
|
||||||
futures = "0.1"
|
futures = "0.1"
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ parking_lot = "0.4"
|
|||||||
polkadot-api = { path = "../api" }
|
polkadot-api = { path = "../api" }
|
||||||
polkadot-primitives = { path = "../primitives" }
|
polkadot-primitives = { path = "../primitives" }
|
||||||
polkadot-runtime = { path = "../runtime" }
|
polkadot-runtime = { path = "../runtime" }
|
||||||
substrate-client = { git = "https://github.com/paritytech/substrate" }
|
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-codec = { git = "https://github.com/paritytech/substrate" }
|
substrate-codec = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-keyring = { git = "https://github.com/paritytech/substrate" }
|
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-extrinsic-pool = { git = "https://github.com/paritytech/substrate" }
|
substrate-extrinsic-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate" }
|
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
ed25519 = { git = "https://github.com/paritytech/substrate" }
|
ed25519 = { git = "https://github.com/paritytech/substrate", branch = "polkadot" }
|
||||||
|
|||||||
Reference in New Issue
Block a user