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 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ab710bf
Updating substrate-demo
arkpar Sep 4, 2018
a5604d6
Consenus fixes
arkpar Sep 4, 2018
d5a0270
Reverted toolchain change
arkpar Sep 4, 2018
6a5ea57
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 4, 2018
eab11ad
Adjusted timeout formula
arkpar Aug 23, 2018
04eb184
Simplfied proposal creation
arkpar Sep 4, 2018
91041c3
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 5, 2018
67107bf
Fixed tests
arkpar Sep 5, 2018
8b7a8bb
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 5, 2018
f3e9299
Fixed a few small issues
arkpar Sep 5, 2018
b3a96ad
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 5, 2018
dbf6d0c
2017->2018
arkpar Sep 6, 2018
3e61f36
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 6, 2018
7d8ef2c
Style
arkpar Sep 6, 2018
7353474
More style
arkpar Sep 6, 2018
946e5e4
Renamed demo executable to substrate
arkpar Sep 6, 2018
a02f2b7
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 6, 2018
9464a68
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 7, 2018
c17c8b4
Style
arkpar Sep 7, 2018
a599454
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 10, 2018
f882159
Fixed compilation after merge
arkpar Sep 10, 2018
544bb89
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 10, 2018
b3295d6
Style
arkpar Sep 10, 2018
18d67cb
Merge branch 'master' of github.com:paritytech/substrate into a-demo
arkpar Sep 10, 2018
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
Prev Previous commit
Next Next commit
Consenus fixes
  • Loading branch information
arkpar committed Sep 4, 2018
commit a5604d6bc2696a6e2323bc76cc2cd246877aedd4
2 changes: 1 addition & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion demo/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ where
}

fn inherent_extrinsics(&self, at: &BlockId, inherent_data: InherentData) -> Result<Vec<UncheckedExtrinsic>> {
self.call_api(at, "inherent_extrinsics", &inherent_data)
let runtime_version = self.runtime_version_at(at)?;
self.call_api(at, "inherent_extrinsics", &(inherent_data, runtime_version.spec_version))
}
}

2 changes: 1 addition & 1 deletion demo/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use substrate_network::specialization::Specialization;
use substrate_network::StatusMessage as GenericFullStatus;

/// Demo protocol id.
pub const PROTOCOL_ID: ::substrate_network::ProtocolId = *b"sub";
pub const PROTOCOL_ID: ::substrate_network::ProtocolId = *b"dot";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left it as is for now so that substrate-demo could sync to the Krumme Lanke network. I'll make it configurable through the spec file in the following PR.


type FullStatus = GenericFullStatus<Block>;

Expand Down
40 changes: 34 additions & 6 deletions demo/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ extern crate substrate_codec as codec;
#[macro_use]
extern crate substrate_codec_derive;

#[cfg_attr(not(feature = "std"), macro_use)]
extern crate substrate_runtime_std as rstd;
extern crate substrate_runtime_balances as balances;
extern crate substrate_runtime_consensus as consensus;
Expand All @@ -57,7 +58,7 @@ extern crate demo_primitives;
mod checked_block;

use rstd::prelude::*;
use demo_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, SessionKey, Signature};
use demo_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, SessionKey, Signature, InherentData};
use runtime_primitives::generic;
use runtime_primitives::traits::{Convert, HasPublicAux, BlakeTwo256};
use version::RuntimeVersion;
Expand All @@ -81,7 +82,7 @@ pub struct Concrete;
/// Runtime version.
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: ver_str!("demo"),
impl_name: ver_str!("parity-demo"),
impl_name: ver_str!("substrate-demo"),
authoring_version: 1,
spec_version: 1,
impl_version: 0,
Expand Down Expand Up @@ -135,7 +136,6 @@ pub type Consensus = consensus::Module<Concrete>;

impl timestamp::Trait for Concrete {
const TIMESTAMP_SET_POSITION: u32 = TIMESTAMP_SET_POSITION;

type Moment = u64;
}

Expand Down Expand Up @@ -231,7 +231,7 @@ pub type Extrinsic = generic::Extrinsic<Address, Index, Call>;
pub type BareExtrinsic = generic::Extrinsic<AccountId, Index, Call>;
/// Executive: handles dispatch to the various modules.
pub type Executive = executive::Executive<Concrete, Block, Balances, Balances,
(((((), Council), Democracy), Staking), Session)>;
((((((), Council), Democracy), Staking), Session), Timestamp)>;

impl_outer_config! {
pub struct GenesisConfig for Concrete {
Expand All @@ -250,12 +250,40 @@ pub mod api {
impl_stubs!(
version => |()| super::Version::version(),
authorities => |()| super::Consensus::authorities(),
events => |()| super::System::events(),
initialise_block => |header| super::Executive::initialise_block(&header),
apply_extrinsic => |extrinsic| super::Executive::apply_extrinsic(extrinsic),
execute_block => |block| super::Executive::execute_block(block),
finalise_block => |()| super::Executive::finalise_block(),
inherent_extrinsics => |(inherent, spec_version)| super::inherent_extrinsics(inherent, spec_version),
validator_count => |()| super::Session::validator_count(),
validators => |()| super::Session::validators()
validators => |()| super::Session::validators(),
timestamp => |()| super::Timestamp::get(),
random_seed => |()| super::System::random_seed(),
account_nonce => |account| super::System::account_nonce(&account),
lookup_address => |address| super::Balances::lookup_address(address)
);
}

/// Produces the list of inherent extrinsics.
fn inherent_extrinsics(data: InherentData, _spec_version: u32) -> Vec<UncheckedExtrinsic> {
let make_inherent = |function| UncheckedExtrinsic::new(
Extrinsic {
signed: Default::default(),
function,
index: 0,
},
Default::default(),
);

let mut inherent = vec![
make_inherent(Call::Timestamp(TimestampCall::set(data.timestamp))),
];

if !data.offline_indices.is_empty() {
inherent.push(make_inherent(
Call::Consensus(ConsensusCall::note_offline(data.offline_indices))
));
}

inherent
}
Binary file removed demo/runtime/wasm/genesis.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.