Update to latest substrate master (#853)

* try to update

* latest updates

* final fixes

* Fix claim w/ vesting logic

* Make claim tests a bit better

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Nikolay Volf
2020-02-19 20:24:57 +03:00
committed by GitHub
parent bbb2fbc556
commit f7303348ff
31 changed files with 837 additions and 647 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "kusama-runtime"
version = "0.7.20"
version = "0.7.21"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
@@ -51,7 +51,7 @@ recovery = { package = "pallet-recovery", git = "https://github.com/paritytech/s
session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
society = { package = "pallet-society", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false, features = ["migrate"] }
staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
+20 -14
View File
@@ -32,13 +32,12 @@ use runtime_common::{attestations, claims, parachains, registrar, slots,
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
MaximumBlockLength,
};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
ApplyExtrinsicResult, Percent, Permill, Perbill, RuntimeDebug,
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
curve::PiecewiseLinear,
traits::{BlakeTwo256, Block as BlockT, StaticLookup, SignedExtension, OpaqueKeys, ConvertInto},
traits::{BlakeTwo256, Block as BlockT, SignedExtension, OpaqueKeys, ConvertInto, IdentityLookup},
};
use version::RuntimeVersion;
use grandpa::{AuthorityId as GrandpaId, fg_primitives};
@@ -77,8 +76,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1048,
impl_version: 0,
spec_version: 1049,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
};
@@ -127,7 +126,7 @@ impl system::Trait for Runtime {
type Hash = Hash;
type Hashing = BlakeTwo256;
type AccountId = AccountId;
type Lookup = Indices;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = generic::Header<BlockNumber, BlakeTwo256>;
type Event = Event;
type BlockHashCount = BlockHashCount;
@@ -136,6 +135,9 @@ impl system::Trait for Runtime {
type AvailableBlockRatio = AvailableBlockRatio;
type Version = Version;
type ModuleToIndex = ModuleToIndex;
type AccountData = balances::AccountData<Balance>;
type OnNewAccount = ();
type OnReapAccount = (Balances, Staking, Session, Recovery, Democracy);
}
parameter_types! {
@@ -157,14 +159,13 @@ parameter_types! {
impl indices::Trait for Runtime {
type AccountIndex = AccountIndex;
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type IsDeadAccount = Balances;
type ResolveHint = indices::SimpleResolveHint<Self::AccountId, Self::AccountIndex>;
}
parameter_types! {
pub const ExistentialDeposit: Balance = 1 * CENTS;
pub const CreationFee: Balance = 1 * CENTS;
}
/// Splits fees 80/20 between treasury and block author.
@@ -180,10 +181,7 @@ impl balances::Trait for Runtime {
type DustRemoval = ();
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type OnReapAccount = (Staking, Session, Democracy);
type OnNewAccount = ();
type TransferPayment = ();
type CreationFee = CreationFee;
type AccountStore = System;
}
parameter_types! {
@@ -625,7 +623,7 @@ construct_runtime! {
// Consensus support.
Authorship: authorship::{Module, Call, Storage},
Staking: staking,
Staking: staking::{Module, Call, Storage, Config<T>, Event<T>},
Offences: offences::{Module, Call, Storage, Event},
Session: session::{Module, Call, Storage, Event, Config<T>},
FinalityTracker: finality_tracker::{Module, Call, Inherent},
@@ -669,7 +667,7 @@ construct_runtime! {
}
/// The address format for describing accounts.
pub type Address = <Indices as StaticLookup>::Source;
pub type Address = AccountId;
/// Block header type as expected by this runtime.
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// Block type as expected by this runtime.
@@ -722,6 +720,10 @@ sp_api::impl_runtime_apis! {
Executive::apply_extrinsic(extrinsic)
}
fn apply_trusted_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
Executive::apply_extrinsic(extrinsic)
}
fn finalize_block() -> <Block as BlockT>::Header {
Executive::finalize_block()
}
@@ -807,6 +809,10 @@ sp_api::impl_runtime_apis! {
secondary_slots: true,
}
}
fn current_epoch_start() -> babe_primitives::SlotNumber {
Babe::current_epoch_start()
}
}
impl authority_discovery_primitives::AuthorityDiscoveryApi<Block> for Runtime {