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

Update substrate to master #182

Closed
wants to merge 2 commits into from
Closed
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
1,632 changes: 821 additions & 811 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion network/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl NetworkService for super::NetworkService {
}

fn gossip_message(&self, topic: Hash, message: Vec<u8>) {
self.gossip_consensus_message(topic, POLKADOT_ENGINE_ID, message);
self.gossip_consensus_message(topic, POLKADOT_ENGINE_ID, message, false);
}

fn drop_gossip(&self, _topic: Hash) { }
Expand Down
1 change: 0 additions & 1 deletion parachain/tests/adder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

//! Basic parachain that adds a number as part of its state.

#[macro_use]
extern crate parity_codec_derive;
extern crate parity_codec as codec;
extern crate polkadot_parachain as parachain;
Expand Down
4 changes: 0 additions & 4 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ srml-sudo = { git = "https://github.com/paritytech/substrate", default-features
srml-system = { git = "https://github.com/paritytech/substrate", default-features = false }
srml-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false }
srml-treasury = { git = "https://github.com/paritytech/substrate", default-features = false }
srml-upgrade-key = { git = "https://github.com/paritytech/substrate", default-features = false }
srml-fees = { git = "https://github.com/paritytech/substrate", default-features = false }
sr-version = { git = "https://github.com/paritytech/substrate", default-features = false }

[dev-dependencies]
Expand Down Expand Up @@ -76,8 +74,6 @@ std = [
"srml-system/std",
"srml-timestamp/std",
"srml-treasury/std",
"srml-upgrade-key/std",
"srml-fees/std",
"sr-version/std",
"serde_derive",
"serde/std",
Expand Down
11 changes: 7 additions & 4 deletions runtime/src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
use rstd::prelude::*;
use sr_io::{keccak_256, secp256k1_ecdsa_recover};
use srml_support::{StorageValue, StorageMap};
use srml_support::traits::{Currency, ArithmeticType};
use srml_support::traits::Currency;
use system::ensure_signed;
use codec::Encode;
#[cfg(feature = "std")]
use sr_primitives::traits::Zero;
use system;

type BalanceOf<T> = <<T as Trait>::Currency as ArithmeticType>::Type;
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;

/// Configuration trait.
pub trait Trait: system::Trait {
/// The overarching event type.
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
type Currency: ArithmeticType + Currency<Self::AccountId, Balance=BalanceOf<Self>>;
type Currency: Currency<Self::AccountId>;
}

type EthereumAddress = [u8; 20];
Expand Down Expand Up @@ -135,7 +135,7 @@ decl_module! {
*t -= balance_due
});

T::Currency::increase_free_balance_creating(&sender, balance_due);
T::Currency::deposit_creating(&sender, balance_due);

// Let's deposit an event to let the outside world know this happened.
Self::deposit_event(RawEvent::Claimed(sender, signer, balance_due));
Expand Down Expand Up @@ -186,6 +186,9 @@ mod tests {
type OnFreeBalanceZero = ();
type OnNewAccount = ();
type Event = ();
type TransactionPayment = ();
type TransferPayment = ();
type DustRemoval = ();
}
impl Trait for Test {
type Event = ();
Expand Down
19 changes: 11 additions & 8 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ extern crate srml_sudo as sudo;
extern crate srml_system as system;
extern crate srml_timestamp as timestamp;
extern crate srml_treasury as treasury;
extern crate srml_fees as fees;

extern crate polkadot_primitives as primitives;

Expand Down Expand Up @@ -159,6 +158,9 @@ impl balances::Trait for Runtime {
type OnFreeBalanceZero = Staking;
type OnNewAccount = Indices;
type Event = Event;
type TransactionPayment = ();
type TransferPayment = ();
type DustRemoval = ();
}

impl consensus::Trait for Runtime {
Expand All @@ -185,6 +187,8 @@ impl staking::Trait for Runtime {
type Currency = Balances;
type OnRewardMinted = Treasury;
type Event = Event;
type Slash = ();
type Reward = ();
}

impl democracy::Trait for Runtime {
Expand All @@ -195,6 +199,8 @@ impl democracy::Trait for Runtime {

impl council::Trait for Runtime {
type Event = Event;
type BadPresentation = ();
type BadReaper = ();
}

impl council::voting::Trait for Runtime {
Expand All @@ -212,6 +218,8 @@ impl treasury::Trait for Runtime {
type ApproveOrigin = council_motions::EnsureMembers<_4>;
type RejectOrigin = council_motions::EnsureMembers<_2>;
type Event = Event;
type MintedForSpending = ();
type ProposalRejection = ();
}

impl grandpa::Trait for Runtime {
Expand All @@ -232,11 +240,6 @@ impl claims::Trait for Runtime {
type Currency = Balances;
}

impl fees::Trait for Runtime {
type Event = Event;
type TransferAsset = Balances;
}

construct_runtime!(
pub enum Runtime with Log(InternalLog: DigestItem<Hash, SessionKey, SessionSignature>) where
Block = Block,
Expand All @@ -262,7 +265,7 @@ construct_runtime!(
Parachains: parachains::{Module, Call, Storage, Config<T>, Inherent},
Sudo: sudo,
Claims: claims,
Fees: fees::{Module, Storage, Config<T>, Event<T>},
//Fees: fees::{Module, Storage, Config<T>, Event<T>},
}
);

Expand All @@ -281,7 +284,7 @@ pub type UncheckedExtrinsic = generic::UncheckedMortalCompactExtrinsic<Address,
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
/// Executive: handles dispatch to the various modules.
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Fees, AllModules>;
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Balances, AllModules>;

impl_runtime_apis! {
impl client_api::Core<Block> for Runtime {
Expand Down
35 changes: 0 additions & 35 deletions runtime/wasm/Cargo.lock

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

14 changes: 5 additions & 9 deletions service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use polkadot_runtime::{
GenesisConfig, ConsensusConfig, CouncilSeatsConfig, DemocracyConfig, TreasuryConfig,
SessionConfig, StakingConfig, TimestampConfig, BalancesConfig, Perbill,
CouncilVotingConfig, GrandpaConfig, SudoConfig, IndicesConfig,
ClaimsConfig, FeesConfig, Permill, StakerStatus
ClaimsConfig, Permill, StakerStatus
};
use telemetry::TelemetryEndpoints;

Expand Down Expand Up @@ -90,6 +90,8 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
transfer_fee: 1 * CENTS,
creation_fee: 1 * CENTS,
vesting: vec![],
transaction_base_fee: 1 * CENTS,
transaction_byte_fee: 10 * MILLICENTS,
}),
indices: Some(IndicesConfig {
ids: endowed_accounts.iter().cloned()
Expand Down Expand Up @@ -154,10 +156,6 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
grandpa: Some(GrandpaConfig {
authorities: initial_authorities.iter().map(|x| (x.2.clone(), 1)).collect(),
}),
fees: Some(FeesConfig {
transaction_base_fee: 1 * CENTS,
transaction_byte_fee: 10 * MILLICENTS,
}),
parachains: Some(Default::default()),
claims: Some(ClaimsConfig {
claims: vec![],
Expand Down Expand Up @@ -238,6 +236,8 @@ pub fn testnet_genesis(
creation_fee: 0,
balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(),
vesting: vec![],
transaction_base_fee: 1,
transaction_byte_fee: 0,
}),
session: Some(SessionConfig {
validators: initial_authorities.iter().map(|x| x.1.clone()).collect(),
Expand Down Expand Up @@ -303,10 +303,6 @@ pub fn testnet_genesis(
grandpa: Some(GrandpaConfig {
authorities: initial_authorities.iter().map(|x| (x.2.clone(), 1)).collect(),
}),
fees: Some(FeesConfig {
transaction_base_fee: 1,
transaction_byte_fee: 0,
}),
}
}

Expand Down
4 changes: 2 additions & 2 deletions service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ construct_service_factory! {
let justification_import = block_import.clone();

config.custom.grandpa_import_setup = Some((block_import.clone(), link_half));
import_queue(
import_queue::<_, _, _, ed25519::Pair>(
slot_duration,
block_import,
Some(justification_import),
Expand All @@ -307,7 +307,7 @@ construct_service_factory! {
{ |config: &mut FactoryFullConfiguration<Self>, client: Arc<LightClient<Self>>| {
let slot_duration = SlotDuration::get_or_compute(&*client)?;

import_queue(
import_queue::<_, _, _, ed25519::Pair>(
slot_duration,
client.clone(),
None,
Expand Down
1 change: 0 additions & 1 deletion test-parachains/adder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#![no_std]

#[macro_use]
extern crate parity_codec_derive;
extern crate parity_codec;
extern crate polkadot_parachain as parachain;
Expand Down