Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ members = [
"substrate/runtime/staking",
"substrate/runtime/system",
"substrate/runtime/timestamp",
"substrate/runtime/version",
"substrate/serializer",
"substrate/state-db",
"substrate/state-machine",
Expand Down
2 changes: 1 addition & 1 deletion demo/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern crate triehash;
#[cfg(test)] extern crate substrate_runtime_system as system;
#[cfg(test)] #[macro_use] extern crate hex_literal;

native_executor_instance!(pub Executor, demo_runtime::api::dispatch, include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm"));
native_executor_instance!(pub Executor, demo_runtime::api::dispatch, demo_runtime::VERSION, include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm"));

#[cfg(test)]
mod tests {
Expand Down
2 changes: 2 additions & 0 deletions demo/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ substrate-runtime-session = { path = "../../substrate/runtime/session" }
substrate-runtime-staking = { path = "../../substrate/runtime/staking" }
substrate-runtime-system = { path = "../../substrate/runtime/system" }
substrate-runtime-timestamp = { path = "../../substrate/runtime/timestamp" }
substrate-runtime-version = { path = "../../substrate/runtime/version" }
demo-primitives = { path = "../primitives" }

[features]
Expand All @@ -44,6 +45,7 @@ std = [
"substrate-runtime-staking/std",
"substrate-runtime-system/std",
"substrate-runtime-timestamp/std",
"substrate-runtime-version/std",
"demo-primitives/std",
"serde_derive",
"serde/std",
Expand Down
20 changes: 20 additions & 0 deletions demo/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ extern crate substrate_runtime_session as session;
extern crate substrate_runtime_staking as staking;
extern crate substrate_runtime_system as system;
extern crate substrate_runtime_timestamp as timestamp;
#[macro_use]
extern crate substrate_runtime_version as version;
extern crate demo_primitives;

use rstd::prelude::*;
use demo_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, SessionKey, Signature};
use runtime_primitives::generic;
use runtime_primitives::traits::{Convert, HasPublicAux, BlakeTwo256};
use version::RuntimeVersion;

#[cfg(any(feature = "std", test))]
pub use runtime_primitives::BuildStorage;
Expand All @@ -59,6 +62,22 @@ pub use runtime_primitives::BuildStorage;
/// Concrete runtime type used to parameterize the various modules.
pub struct Concrete;

/// Runtime version.
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: ver_str!("demo"),
impl_name: ver_str!("parity-demo"),
authoring_version: 0,
spec_version: 0,
impl_version: 0,
};

/// Version module for this concrete runtime.
pub type Version = version::Module<Concrete>;

impl version::Trait for Concrete {
const VERSION: RuntimeVersion = VERSION;
}

impl HasPublicAux for Concrete {
type PublicAux = AccountId;
}
Expand Down Expand Up @@ -189,6 +208,7 @@ impl_outer_config! {

pub mod api {
impl_stubs!(
version => |()| super::Version::version(),
authorities => |()| super::Consensus::authorities(),
initialise_block => |header| super::Executive::initialise_block(&header),
apply_extrinsic => |extrinsic| super::Executive::apply_extrinsic(extrinsic),
Expand Down
30 changes: 12 additions & 18 deletions demo/runtime/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions demo/runtime/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ substrate-runtime-session = { path = "../../../substrate/runtime/session", defau
substrate-runtime-staking = { path = "../../../substrate/runtime/staking", default-features = false }
substrate-runtime-system = { path = "../../../substrate/runtime/system", default-features = false }
substrate-runtime-timestamp = { path = "../../../substrate/runtime/timestamp", default-features = false }
substrate-runtime-version = { path = "../../../substrate/runtime/version", default-features = false }
demo-primitives = { path = "../../primitives", default-features = false }

[features]
Expand All @@ -43,6 +44,7 @@ std = [
"substrate-runtime-staking/std",
"substrate-runtime-system/std",
"substrate-runtime-timestamp/std",
"substrate-runtime-version/std",
"demo-primitives/std",
]

Expand Down
Binary file not shown.
Binary file not shown.
Loading