Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update substrate master #411

Merged
merged 10 commits into from
Sep 2, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
167 changes: 97 additions & 70 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ use substrate_executor::native_executor_instance;
native_executor_instance!(
pub Executor,
polkadot_runtime::api::dispatch,
polkadot_runtime::native_version,
polkadot_runtime::WASM_BINARY
polkadot_runtime::native_version
);
3 changes: 1 addition & 2 deletions runtime/src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ decl_storage! {
}
add_extra_genesis {
config(claims): Vec<(EthereumAddress, BalanceOf<T>)>;

}
}

Expand All @@ -125,7 +124,7 @@ decl_module! {
const Prefix: &[u8] = T::Prefix::get();

/// Deposit one of this module's events by using the default implementation.
fn deposit_event<T>() = default;
fn deposit_event() = default;

/// Make a claim.
#[weight = SimpleDispatchInfo::FixedNormal(1_000_000)]
Expand Down
5 changes: 3 additions & 2 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use sr_staking_primitives::SessionIndex;
use srml_support::{
parameter_types, construct_runtime, traits::{SplitTwoWays, Currency}
};
use im_online::AuthorityId as ImOnlineId;
use im_online::sr25519::{AuthorityId as ImOnlineId};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we use this one in node runtime in substrate though I don't know which one we want here

Copy link
Contributor

Choose a reason for hiding this comment

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


#[cfg(feature = "std")]
pub use staking::StakerStatus;
Expand Down Expand Up @@ -414,6 +414,7 @@ impl offences::Trait for Runtime {
}

impl im_online::Trait for Runtime {
type AuthorityId = ImOnlineId;
type Call = Call;
type Event = Event;
type UncheckedExtrinsic = UncheckedExtrinsic;
Expand Down Expand Up @@ -506,7 +507,7 @@ construct_runtime!(
Session: session::{Module, Call, Storage, Event, Config<T>},
FinalityTracker: finality_tracker::{Module, Call, Inherent},
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config},
ImOnline: im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},

// Governance stuff; uncallable initially.
Democracy: democracy::{Module, Call, Storage, Config, Event<T>},
Expand Down
23 changes: 9 additions & 14 deletions runtime/src/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use primitives::{Hash, Balance, parachain::{
}};
use {system, session};
use srml_support::{
StorageValue, StorageMap, storage::AppendableStorageMap, Parameter, Dispatchable, dispatch::Result,
StorageValue, StorageMap, Parameter, Dispatchable, dispatch::Result,
traits::{Currency, Get, WithdrawReason, ExistenceRequirement}
};

Expand Down Expand Up @@ -256,26 +256,21 @@ decl_storage! {
}

#[cfg(feature = "std")]
fn build<T: Trait>(
storage: &mut (StorageOverlay, ChildrenStorageOverlay),
config: &GenesisConfig<T>
) {
fn build<T: Trait>(config: &GenesisConfig<T>) {
let mut p = config.parachains.clone();
p.sort_unstable_by_key(|&(ref id, _, _)| *id);
p.dedup_by_key(|&mut (ref id, _, _)| *id);

let only_ids: Vec<ParaId> = p.iter().map(|&(ref id, _, _)| id).cloned().collect();

sr_io::with_storage(storage, || {
Parachains::put(&only_ids);
Parachains::put(&only_ids);

for (id, code, genesis) in p {
// no ingress -- a chain cannot be routed to until it is live.
Code::insert(&id, &code);
Heads::insert(&id, &genesis);
<Watermarks<T>>::insert(&id, &sr_primitives::traits::Zero::zero());
}
});
for (id, code, genesis) in p {
// no ingress -- a chain cannot be routed to until it is live.
Code::insert(&id, &code);
Heads::insert(&id, &genesis);
<Watermarks<T>>::insert(&id, &sr_primitives::traits::Zero::zero());
}
}

decl_module! {
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ decl_event!(

decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
fn deposit_event<T>() = default;
fn deposit_event() = default;

fn on_initialize(n: T::BlockNumber) {
let lease_period = T::LeasePeriod::get();
Expand Down
2 changes: 1 addition & 1 deletion service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use telemetry::TelemetryEndpoints;
use hex_literal::hex;
use babe_primitives::AuthorityId as BabeId;
use grandpa::AuthorityId as GrandpaId;
use im_online::AuthorityId as ImOnlineId;
use im_online::sr25519::{AuthorityId as ImOnlineId};
use srml_staking::Forcing;

const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
Expand Down