mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
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:
Generated
+678
-518
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -4,7 +4,7 @@ path = "src/main.rs"
|
|||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "polkadot"
|
name = "polkadot"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-availability-store"
|
name = "polkadot-availability-store"
|
||||||
description = "Persistent database for parachain data"
|
description = "Persistent database for parachain data"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ impl<I, P> BlockImport<Block> for AvailabilityBlockImport<I, P> where
|
|||||||
target: LOG_TARGET,
|
target: LOG_TARGET,
|
||||||
"Importing block #{}, ({})",
|
"Importing block #{}, ({})",
|
||||||
block.header.number(),
|
block.header.number(),
|
||||||
block.post_header().hash()
|
block.post_hash(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(ref extrinsics) = block.body {
|
if let Some(ref extrinsics) = block.body {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-cli"
|
name = "polkadot-cli"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
description = "Polkadot node implementation in Rust."
|
description = "Polkadot node implementation in Rust."
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-collator"
|
name = "polkadot-collator"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
description = "Collator node implementation"
|
description = "Collator node implementation"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-erasure-coding"
|
name = "polkadot-erasure-coding"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-network"
|
name = "polkadot-network"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
description = "Polkadot-specific networking protocol"
|
description = "Polkadot-specific networking protocol"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -283,11 +283,19 @@ pub fn register_validator<C: ChainContext + 'static, S: NetworkSpecialization<Bl
|
|||||||
let gossip_side = validator.clone();
|
let gossip_side = validator.clone();
|
||||||
let gossip_engine = sc_network_gossip::GossipEngine::new(
|
let gossip_engine = sc_network_gossip::GossipEngine::new(
|
||||||
service.clone(),
|
service.clone(),
|
||||||
executor,
|
|
||||||
POLKADOT_ENGINE_ID,
|
POLKADOT_ENGINE_ID,
|
||||||
gossip_side,
|
gossip_side,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Ideally this would not be spawned as an orphaned task, but polled by
|
||||||
|
// `RegisteredMessageValidator` which in turn would be polled by a `ValidationNetwork`.
|
||||||
|
let spawn_res = executor.spawn_obj(futures::task::FutureObj::from(Box::new(gossip_engine.clone())));
|
||||||
|
|
||||||
|
// Note: we consider the chances of an error to spawn a background task almost null.
|
||||||
|
if spawn_res.is_err() {
|
||||||
|
log::error!(target: "polkadot-gossip", "Failed to spawn background task");
|
||||||
|
}
|
||||||
|
|
||||||
RegisteredMessageValidator {
|
RegisteredMessageValidator {
|
||||||
inner: validator as _,
|
inner: validator as _,
|
||||||
service: Some(service),
|
service: Some(service),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-parachain"
|
name = "polkadot-parachain"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
description = "Types and utilities for creating and working with parachains"
|
description = "Types and utilities for creating and working with parachains"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-primitives"
|
name = "polkadot-primitives"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-rpc"
|
name = "polkadot-rpc"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-runtime-common"
|
name = "polkadot-runtime-common"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -125,14 +125,14 @@ decl_module! {
|
|||||||
/// Provide candidate receipts for parachains, in ascending order by id.
|
/// Provide candidate receipts for parachains, in ascending order by id.
|
||||||
fn more_attestations(origin, _more: MoreAttestations) -> DispatchResult {
|
fn more_attestations(origin, _more: MoreAttestations) -> DispatchResult {
|
||||||
ensure_none(origin)?;
|
ensure_none(origin)?;
|
||||||
ensure!(!<DidUpdate>::exists(), Error::<T>::TooManyAttestations);
|
ensure!(!DidUpdate::exists(), Error::<T>::TooManyAttestations);
|
||||||
<DidUpdate>::put(true);
|
DidUpdate::put(true);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_finalize(_n: T::BlockNumber) {
|
fn on_finalize(_n: T::BlockNumber) {
|
||||||
<DidUpdate>::kill();
|
DidUpdate::kill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
use rstd::prelude::*;
|
use rstd::prelude::*;
|
||||||
use sp_io::{hashing::keccak_256, crypto::secp256k1_ecdsa_recover};
|
use sp_io::{hashing::keccak_256, crypto::secp256k1_ecdsa_recover};
|
||||||
use frame_support::{decl_event, decl_storage, decl_module, decl_error, ensure};
|
use frame_support::{decl_event, decl_storage, decl_module, decl_error};
|
||||||
use frame_support::{dispatch::DispatchResult, weights::SimpleDispatchInfo};
|
use frame_support::weights::SimpleDispatchInfo;
|
||||||
use frame_support::traits::{Currency, Get, VestingSchedule};
|
use frame_support::traits::{Currency, Get, VestingSchedule};
|
||||||
use system::{ensure_root, ensure_none};
|
use system::{ensure_root, ensure_none};
|
||||||
use codec::{Encode, Decode};
|
use codec::{Encode, Decode};
|
||||||
@@ -161,31 +161,18 @@ decl_module! {
|
|||||||
let balance_due = <Claims<T>>::get(&signer)
|
let balance_due = <Claims<T>>::get(&signer)
|
||||||
.ok_or(Error::<T>::SignerHasNoClaim)?;
|
.ok_or(Error::<T>::SignerHasNoClaim)?;
|
||||||
|
|
||||||
let maybe_vested = <Vesting<T>>::get(&signer);
|
let new_total = Self::total().checked_sub(&balance_due).ok_or(Error::<T>::PotUnderflow)?;
|
||||||
|
|
||||||
// If this fails, destination account already has a vesting schedule
|
|
||||||
// applied to it, and this claim should not be processed.
|
|
||||||
ensure!(
|
|
||||||
maybe_vested.is_none() || T::VestingSchedule::vesting_balance(&dest).is_zero(),
|
|
||||||
Error::<T>::DestinationVesting
|
|
||||||
);
|
|
||||||
|
|
||||||
<Total<T>>::mutate(|t| -> DispatchResult {
|
|
||||||
*t = t.checked_sub(&balance_due).ok_or(Error::<T>::PotUnderflow)?;
|
|
||||||
Ok(())
|
|
||||||
})?;
|
|
||||||
|
|
||||||
// This must happen before the add_vesting_schedule otherwise the schedule will be
|
|
||||||
// nullified.
|
|
||||||
CurrencyOf::<T>::deposit_creating(&dest, balance_due);
|
|
||||||
|
|
||||||
// Check if this claim should have a vesting schedule.
|
// Check if this claim should have a vesting schedule.
|
||||||
if let Some(vs) = maybe_vested {
|
if let Some(vs) = <Vesting<T>>::get(&signer) {
|
||||||
// Should never fail since we ensured that the destination is not already vesting.
|
// If this fails, destination account already has a vesting schedule
|
||||||
// However, we already deposited, so can't error out here anyway.
|
// applied to it, and this claim should not be processed.
|
||||||
let _ = T::VestingSchedule::add_vesting_schedule(&dest, vs.0, vs.1, vs.2);
|
T::VestingSchedule::add_vesting_schedule(&dest, vs.0, vs.1, vs.2)
|
||||||
|
.map_err(|_| Error::<T>::DestinationVesting)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CurrencyOf::<T>::deposit_creating(&dest, balance_due);
|
||||||
|
<Total<T>>::put(new_total);
|
||||||
<Claims<T>>::remove(&signer);
|
<Claims<T>>::remove(&signer);
|
||||||
<Vesting<T>>::remove(&signer);
|
<Vesting<T>>::remove(&signer);
|
||||||
|
|
||||||
@@ -268,7 +255,7 @@ impl<T: Trait> sp_runtime::traits::ValidateUnsigned for Module<T> {
|
|||||||
).into();
|
).into();
|
||||||
};
|
};
|
||||||
|
|
||||||
if !<Claims<T>>::exists(&signer) {
|
if !<Claims<T>>::contains_key(&signer) {
|
||||||
return Err(InvalidTransaction::Custom(
|
return Err(InvalidTransaction::Custom(
|
||||||
ValidityError::SignerHasNoClaim.into(),
|
ValidityError::SignerHasNoClaim.into(),
|
||||||
).into());
|
).into());
|
||||||
@@ -335,6 +322,9 @@ mod tests {
|
|||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type ModuleToIndex = ();
|
type ModuleToIndex = ();
|
||||||
|
type AccountData = balances::AccountData<u64>;
|
||||||
|
type OnNewAccount = ();
|
||||||
|
type OnReapAccount = Balances;
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
@@ -344,13 +334,10 @@ mod tests {
|
|||||||
|
|
||||||
impl balances::Trait for Test {
|
impl balances::Trait for Test {
|
||||||
type Balance = u64;
|
type Balance = u64;
|
||||||
type OnReapAccount = System;
|
|
||||||
type OnNewAccount = ();
|
|
||||||
type TransferPayment = ();
|
|
||||||
type DustRemoval = ();
|
|
||||||
type Event = ();
|
type Event = ();
|
||||||
|
type DustRemoval = ();
|
||||||
type ExistentialDeposit = ExistentialDeposit;
|
type ExistentialDeposit = ExistentialDeposit;
|
||||||
type CreationFee = CreationFee;
|
type AccountStore = System;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl vesting::Trait for Test {
|
impl vesting::Trait for Test {
|
||||||
@@ -431,10 +418,11 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn claiming_works() {
|
fn claiming_works() {
|
||||||
new_test_ext().execute_with(|| {
|
new_test_ext().execute_with(|| {
|
||||||
assert_eq!(Balances::free_balance(&42), 0);
|
assert_eq!(Balances::free_balance(42), 0);
|
||||||
assert_ok!(Claims::claim(Origin::NONE, 42, sig(&alice(), &42u64.encode())));
|
assert_ok!(Claims::claim(Origin::NONE, 42, sig(&alice(), &42u64.encode())));
|
||||||
assert_eq!(Balances::free_balance(&42), 100);
|
assert_eq!(Balances::free_balance(&42), 100);
|
||||||
assert_eq!(Vesting::vesting_balance(&42), 50);
|
assert_eq!(Vesting::vesting_balance(&42), 50);
|
||||||
|
assert_eq!(Claims::total(), 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,15 +433,17 @@ mod tests {
|
|||||||
Claims::mint_claim(Origin::signed(42), eth(&bob()), 200, None),
|
Claims::mint_claim(Origin::signed(42), eth(&bob()), 200, None),
|
||||||
sp_runtime::traits::BadOrigin,
|
sp_runtime::traits::BadOrigin,
|
||||||
);
|
);
|
||||||
assert_eq!(Balances::free_balance(&42), 0);
|
assert_eq!(Balances::free_balance(42), 0);
|
||||||
assert_noop!(
|
assert_noop!(
|
||||||
Claims::claim(Origin::NONE, 69, sig(&bob(), &69u64.encode())),
|
Claims::claim(Origin::NONE, 69, sig(&bob(), &69u64.encode())),
|
||||||
Error::<Test>::SignerHasNoClaim
|
Error::<Test>::SignerHasNoClaim
|
||||||
);
|
);
|
||||||
assert_ok!(Claims::mint_claim(Origin::ROOT, eth(&bob()), 200, None));
|
assert_ok!(Claims::mint_claim(Origin::ROOT, eth(&bob()), 200, None));
|
||||||
|
assert_eq!(Claims::total(), 300);
|
||||||
assert_ok!(Claims::claim(Origin::NONE, 69, sig(&bob(), &69u64.encode())));
|
assert_ok!(Claims::claim(Origin::NONE, 69, sig(&bob(), &69u64.encode())));
|
||||||
assert_eq!(Balances::free_balance(69), 200);
|
assert_eq!(Balances::free_balance(&69), 200);
|
||||||
assert_eq!(Vesting::vesting_balance(&69), 0);
|
assert_eq!(Vesting::vesting_balance(&69), 0);
|
||||||
|
assert_eq!(Claims::total(), 100);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,7 +461,7 @@ mod tests {
|
|||||||
);
|
);
|
||||||
assert_ok!(Claims::mint_claim(Origin::ROOT, eth(&bob()), 200, Some((50, 10, 1))));
|
assert_ok!(Claims::mint_claim(Origin::ROOT, eth(&bob()), 200, Some((50, 10, 1))));
|
||||||
assert_ok!(Claims::claim(Origin::NONE, 69, sig(&bob(), &69u64.encode())));
|
assert_ok!(Claims::claim(Origin::NONE, 69, sig(&bob(), &69u64.encode())));
|
||||||
assert_eq!(Balances::free_balance(69), 200);
|
assert_eq!(Balances::free_balance(&69), 200);
|
||||||
assert_eq!(Vesting::vesting_balance(&69), 50);
|
assert_eq!(Vesting::vesting_balance(&69), 50);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -499,6 +489,30 @@ mod tests {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn claiming_while_vested_doesnt_work() {
|
||||||
|
new_test_ext().execute_with(|| {
|
||||||
|
assert_eq!(Claims::total(), 100);
|
||||||
|
// A user is already vested
|
||||||
|
assert_ok!(<Test as Trait>::VestingSchedule::add_vesting_schedule(&69, 1000, 100, 10));
|
||||||
|
CurrencyOf::<Test>::make_free_balance_be(&69, 1000);
|
||||||
|
assert_eq!(Balances::free_balance(69), 1000);
|
||||||
|
assert_ok!(Claims::mint_claim(Origin::ROOT, eth(&bob()), 200, Some((50, 10, 1))));
|
||||||
|
// New total
|
||||||
|
assert_eq!(Claims::total(), 300);
|
||||||
|
|
||||||
|
// They should not be able to claim
|
||||||
|
assert_noop!(
|
||||||
|
Claims::claim(Origin::NONE, 69, sig(&bob(), &69u64.encode())),
|
||||||
|
Error::<Test>::DestinationVesting
|
||||||
|
);
|
||||||
|
// Everything should be unchanged
|
||||||
|
assert_eq!(Claims::total(), 300);
|
||||||
|
assert_eq!(Balances::free_balance(69), 1000);
|
||||||
|
assert_eq!(Vesting::vesting_balance(&69), 1000);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn non_sender_sig_doesnt_work() {
|
fn non_sender_sig_doesnt_work() {
|
||||||
new_test_ext().execute_with(|| {
|
new_test_ext().execute_with(|| {
|
||||||
|
|||||||
@@ -614,20 +614,19 @@ mod tests {
|
|||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type ModuleToIndex = ();
|
type ModuleToIndex = ();
|
||||||
|
type AccountData = balances::AccountData<u64>;
|
||||||
|
type OnNewAccount = ();
|
||||||
|
type OnReapAccount = Balances;
|
||||||
}
|
}
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const ExistentialDeposit: u64 = 1;
|
pub const ExistentialDeposit: u64 = 1;
|
||||||
pub const CreationFee: u64 = 0;
|
|
||||||
}
|
}
|
||||||
impl balances::Trait for Test {
|
impl balances::Trait for Test {
|
||||||
type Balance = u64;
|
type Balance = u64;
|
||||||
type OnReapAccount = System;
|
|
||||||
type OnNewAccount = ();
|
|
||||||
type TransferPayment = ();
|
|
||||||
type DustRemoval = ();
|
|
||||||
type Event = ();
|
type Event = ();
|
||||||
|
type DustRemoval = ();
|
||||||
type ExistentialDeposit = ExistentialDeposit;
|
type ExistentialDeposit = ExistentialDeposit;
|
||||||
type CreationFee = CreationFee;
|
type AccountStore = System;
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
|
|||||||
@@ -889,6 +889,9 @@ mod tests {
|
|||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type ModuleToIndex = ();
|
type ModuleToIndex = ();
|
||||||
|
type AccountData = balances::AccountData<u128>;
|
||||||
|
type OnNewAccount = ();
|
||||||
|
type OnReapAccount = ();
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
@@ -945,18 +948,14 @@ mod tests {
|
|||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const ExistentialDeposit: Balance = 1;
|
pub const ExistentialDeposit: Balance = 1;
|
||||||
pub const CreationFee: Balance = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl balances::Trait for Test {
|
impl balances::Trait for Test {
|
||||||
type Balance = Balance;
|
type Balance = u128;
|
||||||
type OnReapAccount = System;
|
|
||||||
type OnNewAccount = ();
|
|
||||||
type Event = ();
|
|
||||||
type DustRemoval = ();
|
type DustRemoval = ();
|
||||||
|
type Event = ();
|
||||||
type ExistentialDeposit = ExistentialDeposit;
|
type ExistentialDeposit = ExistentialDeposit;
|
||||||
type TransferPayment = ();
|
type AccountStore = System;
|
||||||
type CreationFee = CreationFee;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pallet_staking_reward_curve::build! {
|
pallet_staking_reward_curve::build! {
|
||||||
|
|||||||
@@ -89,8 +89,7 @@ impl<T: Trait> Registrar<T::AccountId> for Module<T> {
|
|||||||
code: Vec<u8>,
|
code: Vec<u8>,
|
||||||
initial_head_data: Vec<u8>,
|
initial_head_data: Vec<u8>,
|
||||||
) -> DispatchResult {
|
) -> DispatchResult {
|
||||||
ensure!(!Paras::exists(id), Error::<T>::ParaAlreadyExists);
|
ensure!(!Paras::contains_key(id), Error::<T>::ParaAlreadyExists);
|
||||||
|
|
||||||
if let Scheduling::Always = info.scheduling {
|
if let Scheduling::Always = info.scheduling {
|
||||||
Parachains::mutate(|parachains|
|
Parachains::mutate(|parachains|
|
||||||
match parachains.binary_search(&id) {
|
match parachains.binary_search(&id) {
|
||||||
@@ -703,22 +702,21 @@ mod tests {
|
|||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type ModuleToIndex = ();
|
type ModuleToIndex = ();
|
||||||
|
type AccountData = balances::AccountData<u128>;
|
||||||
|
type OnNewAccount = ();
|
||||||
|
type OnReapAccount = Balances;
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const ExistentialDeposit: Balance = 1;
|
pub const ExistentialDeposit: Balance = 1;
|
||||||
pub const CreationFee: Balance = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl balances::Trait for Test {
|
impl balances::Trait for Test {
|
||||||
type OnNewAccount = ();
|
type Balance = u128;
|
||||||
type OnReapAccount = System;
|
|
||||||
type Balance = Balance;
|
|
||||||
type Event = ();
|
|
||||||
type DustRemoval = ();
|
type DustRemoval = ();
|
||||||
|
type Event = ();
|
||||||
type ExistentialDeposit = ExistentialDeposit;
|
type ExistentialDeposit = ExistentialDeposit;
|
||||||
type TransferPayment = ();
|
type AccountStore = System;
|
||||||
type CreationFee = CreationFee;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types!{
|
parameter_types!{
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ decl_storage! {
|
|||||||
|
|
||||||
impl<T: Trait> SwapAux for Module<T> {
|
impl<T: Trait> SwapAux for Module<T> {
|
||||||
fn ensure_can_swap(one: ParaId, other: ParaId) -> Result<(), &'static str> {
|
fn ensure_can_swap(one: ParaId, other: ParaId) -> Result<(), &'static str> {
|
||||||
if <Onboarding<T>>::exists(one) || <Onboarding<T>>::exists(other) {
|
if <Onboarding<T>>::contains_key(one) || <Onboarding<T>>::contains_key(other) {
|
||||||
Err("can't swap an undeployed parachain")?
|
Err("can't swap an undeployed parachain")?
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -292,7 +292,7 @@ decl_module! {
|
|||||||
// winner information is duplicated from the previous block in case no bids happened
|
// winner information is duplicated from the previous block in case no bids happened
|
||||||
// in this block.
|
// in this block.
|
||||||
if let Some(offset) = Self::is_ending(now) {
|
if let Some(offset) = Self::is_ending(now) {
|
||||||
if !<Winning<T>>::exists(&offset) {
|
if !<Winning<T>>::contains_key(&offset) {
|
||||||
<Winning<T>>::insert(offset,
|
<Winning<T>>::insert(offset,
|
||||||
offset.checked_sub(&One::one())
|
offset.checked_sub(&One::one())
|
||||||
.and_then(<Winning<T>>::get)
|
.and_then(<Winning<T>>::get)
|
||||||
@@ -915,22 +915,21 @@ mod tests {
|
|||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type ModuleToIndex = ();
|
type ModuleToIndex = ();
|
||||||
|
type AccountData = balances::AccountData<u64>;
|
||||||
|
type OnNewAccount = ();
|
||||||
|
type OnReapAccount = Balances;
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const ExistentialDeposit: u64 = 1;
|
pub const ExistentialDeposit: u64 = 1;
|
||||||
pub const CreationFee: u64 = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl balances::Trait for Test {
|
impl balances::Trait for Test {
|
||||||
type Balance = u64;
|
type Balance = u64;
|
||||||
type Event = ();
|
type Event = ();
|
||||||
type OnNewAccount = ();
|
|
||||||
type OnReapAccount = System;
|
|
||||||
type DustRemoval = ();
|
type DustRemoval = ();
|
||||||
type ExistentialDeposit = ExistentialDeposit;
|
type ExistentialDeposit = ExistentialDeposit;
|
||||||
type CreationFee = CreationFee;
|
type AccountStore = System;
|
||||||
type TransferPayment = ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
thread_local! {
|
thread_local! {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "kusama-runtime"
|
name = "kusama-runtime"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
build = "build.rs"
|
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 }
|
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 }
|
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 }
|
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" }
|
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 = { 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 }
|
system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
|
||||||
|
|||||||
@@ -32,13 +32,12 @@ use runtime_common::{attestations, claims, parachains, registrar, slots,
|
|||||||
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
||||||
MaximumBlockLength,
|
MaximumBlockLength,
|
||||||
};
|
};
|
||||||
|
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
create_runtime_str, generic, impl_opaque_keys,
|
create_runtime_str, generic, impl_opaque_keys,
|
||||||
ApplyExtrinsicResult, Percent, Permill, Perbill, RuntimeDebug,
|
ApplyExtrinsicResult, Percent, Permill, Perbill, RuntimeDebug,
|
||||||
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
|
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
|
||||||
curve::PiecewiseLinear,
|
curve::PiecewiseLinear,
|
||||||
traits::{BlakeTwo256, Block as BlockT, StaticLookup, SignedExtension, OpaqueKeys, ConvertInto},
|
traits::{BlakeTwo256, Block as BlockT, SignedExtension, OpaqueKeys, ConvertInto, IdentityLookup},
|
||||||
};
|
};
|
||||||
use version::RuntimeVersion;
|
use version::RuntimeVersion;
|
||||||
use grandpa::{AuthorityId as GrandpaId, fg_primitives};
|
use grandpa::{AuthorityId as GrandpaId, fg_primitives};
|
||||||
@@ -77,8 +76,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("kusama"),
|
spec_name: create_runtime_str!("kusama"),
|
||||||
impl_name: create_runtime_str!("parity-kusama"),
|
impl_name: create_runtime_str!("parity-kusama"),
|
||||||
authoring_version: 2,
|
authoring_version: 2,
|
||||||
spec_version: 1048,
|
spec_version: 1049,
|
||||||
impl_version: 0,
|
impl_version: 1,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -127,7 +126,7 @@ impl system::Trait for Runtime {
|
|||||||
type Hash = Hash;
|
type Hash = Hash;
|
||||||
type Hashing = BlakeTwo256;
|
type Hashing = BlakeTwo256;
|
||||||
type AccountId = AccountId;
|
type AccountId = AccountId;
|
||||||
type Lookup = Indices;
|
type Lookup = IdentityLookup<Self::AccountId>;
|
||||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
@@ -136,6 +135,9 @@ impl system::Trait for Runtime {
|
|||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
type ModuleToIndex = ModuleToIndex;
|
type ModuleToIndex = ModuleToIndex;
|
||||||
|
type AccountData = balances::AccountData<Balance>;
|
||||||
|
type OnNewAccount = ();
|
||||||
|
type OnReapAccount = (Balances, Staking, Session, Recovery, Democracy);
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
@@ -157,14 +159,13 @@ parameter_types! {
|
|||||||
|
|
||||||
impl indices::Trait for Runtime {
|
impl indices::Trait for Runtime {
|
||||||
type AccountIndex = AccountIndex;
|
type AccountIndex = AccountIndex;
|
||||||
|
type Currency = Balances;
|
||||||
|
type Deposit = IndexDeposit;
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type IsDeadAccount = Balances;
|
|
||||||
type ResolveHint = indices::SimpleResolveHint<Self::AccountId, Self::AccountIndex>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const ExistentialDeposit: Balance = 1 * CENTS;
|
pub const ExistentialDeposit: Balance = 1 * CENTS;
|
||||||
pub const CreationFee: Balance = 1 * CENTS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Splits fees 80/20 between treasury and block author.
|
/// Splits fees 80/20 between treasury and block author.
|
||||||
@@ -180,10 +181,7 @@ impl balances::Trait for Runtime {
|
|||||||
type DustRemoval = ();
|
type DustRemoval = ();
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type ExistentialDeposit = ExistentialDeposit;
|
type ExistentialDeposit = ExistentialDeposit;
|
||||||
type OnReapAccount = (Staking, Session, Democracy);
|
type AccountStore = System;
|
||||||
type OnNewAccount = ();
|
|
||||||
type TransferPayment = ();
|
|
||||||
type CreationFee = CreationFee;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
@@ -625,7 +623,7 @@ construct_runtime! {
|
|||||||
|
|
||||||
// Consensus support.
|
// Consensus support.
|
||||||
Authorship: authorship::{Module, Call, Storage},
|
Authorship: authorship::{Module, Call, Storage},
|
||||||
Staking: staking,
|
Staking: staking::{Module, Call, Storage, Config<T>, Event<T>},
|
||||||
Offences: offences::{Module, Call, Storage, Event},
|
Offences: offences::{Module, Call, Storage, Event},
|
||||||
Session: session::{Module, Call, Storage, Event, Config<T>},
|
Session: session::{Module, Call, Storage, Event, Config<T>},
|
||||||
FinalityTracker: finality_tracker::{Module, Call, Inherent},
|
FinalityTracker: finality_tracker::{Module, Call, Inherent},
|
||||||
@@ -669,7 +667,7 @@ construct_runtime! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The address format for describing accounts.
|
/// 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.
|
/// Block header type as expected by this runtime.
|
||||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||||
/// Block type as expected by this runtime.
|
/// Block type as expected by this runtime.
|
||||||
@@ -722,6 +720,10 @@ sp_api::impl_runtime_apis! {
|
|||||||
Executive::apply_extrinsic(extrinsic)
|
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 {
|
fn finalize_block() -> <Block as BlockT>::Header {
|
||||||
Executive::finalize_block()
|
Executive::finalize_block()
|
||||||
}
|
}
|
||||||
@@ -807,6 +809,10 @@ sp_api::impl_runtime_apis! {
|
|||||||
secondary_slots: true,
|
secondary_slots: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn current_epoch_start() -> babe_primitives::SlotNumber {
|
||||||
|
Babe::current_epoch_start()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl authority_discovery_primitives::AuthorityDiscoveryApi<Block> for Runtime {
|
impl authority_discovery_primitives::AuthorityDiscoveryApi<Block> for Runtime {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-runtime"
|
name = "polkadot-runtime"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
@@ -48,7 +48,7 @@ offences = { package = "pallet-offences", git = "https://github.com/paritytech/s
|
|||||||
randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
|
randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
|
||||||
session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
|
session = { package = "pallet-session", 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 }
|
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" }
|
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 = { 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 }
|
system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
|
||||||
|
|||||||
@@ -38,7 +38,10 @@ use sp_runtime::{
|
|||||||
ApplyExtrinsicResult, Percent, Permill, Perbill, RuntimeDebug,
|
ApplyExtrinsicResult, Percent, Permill, Perbill, RuntimeDebug,
|
||||||
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
|
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
|
||||||
curve::PiecewiseLinear,
|
curve::PiecewiseLinear,
|
||||||
traits::{BlakeTwo256, Block as BlockT, StaticLookup, SignedExtension, OpaqueKeys, ConvertInto},
|
traits::{
|
||||||
|
BlakeTwo256, Block as BlockT, SignedExtension, OpaqueKeys, ConvertInto,
|
||||||
|
IdentityLookup
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use version::RuntimeVersion;
|
use version::RuntimeVersion;
|
||||||
use grandpa::{AuthorityId as GrandpaId, fg_primitives};
|
use grandpa::{AuthorityId as GrandpaId, fg_primitives};
|
||||||
@@ -78,7 +81,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("polkadot"),
|
spec_name: create_runtime_str!("polkadot"),
|
||||||
impl_name: create_runtime_str!("parity-polkadot"),
|
impl_name: create_runtime_str!("parity-polkadot"),
|
||||||
authoring_version: 2,
|
authoring_version: 2,
|
||||||
spec_version: 1003,
|
spec_version: 1004,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
};
|
};
|
||||||
@@ -131,7 +134,7 @@ impl system::Trait for Runtime {
|
|||||||
type Hash = Hash;
|
type Hash = Hash;
|
||||||
type Hashing = BlakeTwo256;
|
type Hashing = BlakeTwo256;
|
||||||
type AccountId = AccountId;
|
type AccountId = AccountId;
|
||||||
type Lookup = Indices;
|
type Lookup = IdentityLookup<AccountId>;
|
||||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
@@ -140,6 +143,9 @@ impl system::Trait for Runtime {
|
|||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
type ModuleToIndex = ModuleToIndex;
|
type ModuleToIndex = ModuleToIndex;
|
||||||
|
type AccountData = balances::AccountData<Balance>;
|
||||||
|
type OnNewAccount = ();
|
||||||
|
type OnReapAccount = (Balances, Staking, Session, Democracy);
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
@@ -161,14 +167,13 @@ parameter_types! {
|
|||||||
|
|
||||||
impl indices::Trait for Runtime {
|
impl indices::Trait for Runtime {
|
||||||
type AccountIndex = AccountIndex;
|
type AccountIndex = AccountIndex;
|
||||||
|
type Currency = Balances;
|
||||||
|
type Deposit = IndexDeposit;
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type IsDeadAccount = Balances;
|
|
||||||
type ResolveHint = indices::SimpleResolveHint<Self::AccountId, Self::AccountIndex>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const ExistentialDeposit: Balance = 100 * CENTS;
|
pub const ExistentialDeposit: Balance = 100 * CENTS;
|
||||||
pub const CreationFee: Balance = 1 * CENTS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Splits fees 80/20 between treasury and block author.
|
/// Splits fees 80/20 between treasury and block author.
|
||||||
@@ -184,10 +189,7 @@ impl balances::Trait for Runtime {
|
|||||||
type Event = Event;
|
type Event = Event;
|
||||||
type DustRemoval = ();
|
type DustRemoval = ();
|
||||||
type ExistentialDeposit = ExistentialDeposit;
|
type ExistentialDeposit = ExistentialDeposit;
|
||||||
type OnReapAccount = (Staking, Session, Democracy);
|
type AccountStore = System;
|
||||||
type OnNewAccount = ();
|
|
||||||
type TransferPayment = ();
|
|
||||||
type CreationFee = CreationFee;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
@@ -529,7 +531,7 @@ impl vesting::Trait for Runtime {
|
|||||||
|
|
||||||
impl sudo::Trait for Runtime {
|
impl sudo::Trait for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type Proposal = Call;
|
type Call = Call;
|
||||||
}
|
}
|
||||||
|
|
||||||
construct_runtime! {
|
construct_runtime! {
|
||||||
@@ -546,13 +548,13 @@ construct_runtime! {
|
|||||||
Babe: babe::{Module, Call, Storage, Config, Inherent(Timestamp)},
|
Babe: babe::{Module, Call, Storage, Config, Inherent(Timestamp)},
|
||||||
|
|
||||||
Timestamp: timestamp::{Module, Call, Storage, Inherent},
|
Timestamp: timestamp::{Module, Call, Storage, Inherent},
|
||||||
Indices: indices,
|
Indices: indices::{Module, Call, Storage, Config<T>, Event<T>},
|
||||||
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
|
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||||
TransactionPayment: transaction_payment::{Module, Storage},
|
TransactionPayment: transaction_payment::{Module, Storage},
|
||||||
|
|
||||||
// Consensus support.
|
// Consensus support.
|
||||||
Authorship: authorship::{Module, Call, Storage},
|
Authorship: authorship::{Module, Call, Storage},
|
||||||
Staking: staking::{default},
|
Staking: staking::{Module, Call, Storage, Config<T>, Event<T>},
|
||||||
Offences: offences::{Module, Call, Storage, Event},
|
Offences: offences::{Module, Call, Storage, Event},
|
||||||
Session: session::{Module, Call, Storage, Event, Config<T>},
|
Session: session::{Module, Call, Storage, Event, Config<T>},
|
||||||
FinalityTracker: finality_tracker::{Module, Call, Inherent},
|
FinalityTracker: finality_tracker::{Module, Call, Inherent},
|
||||||
@@ -581,12 +583,12 @@ construct_runtime! {
|
|||||||
Vesting: vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
Vesting: vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||||
|
|
||||||
// Sudo. Last module. Usable initially, but removed once governance enabled.
|
// Sudo. Last module. Usable initially, but removed once governance enabled.
|
||||||
Sudo: sudo,
|
Sudo: sudo::{Module, Call, Storage, Config<T>, Event<T>},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The address format for describing accounts.
|
/// 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.
|
/// Block header type as expected by this runtime.
|
||||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||||
/// Block type as expected by this runtime.
|
/// Block type as expected by this runtime.
|
||||||
@@ -640,6 +642,10 @@ sp_api::impl_runtime_apis! {
|
|||||||
Executive::apply_extrinsic(extrinsic)
|
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 {
|
fn finalize_block() -> <Block as BlockT>::Header {
|
||||||
Executive::finalize_block()
|
Executive::finalize_block()
|
||||||
}
|
}
|
||||||
@@ -725,6 +731,10 @@ sp_api::impl_runtime_apis! {
|
|||||||
secondary_slots: true,
|
secondary_slots: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn current_epoch_start() -> babe_primitives::SlotNumber {
|
||||||
|
Babe::current_epoch_start()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl authority_discovery_primitives::AuthorityDiscoveryApi<Block> for Runtime {
|
impl authority_discovery_primitives::AuthorityDiscoveryApi<Block> for Runtime {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-service"
|
name = "polkadot-service"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -171,9 +171,7 @@ fn staging_testnet_config_genesis() -> polkadot::GenesisConfig {
|
|||||||
.collect(),
|
.collect(),
|
||||||
}),
|
}),
|
||||||
indices: Some(polkadot::IndicesConfig {
|
indices: Some(polkadot::IndicesConfig {
|
||||||
ids: endowed_accounts.iter().cloned()
|
indices: vec![],
|
||||||
.chain(initial_authorities.iter().map(|x| x.0.clone()))
|
|
||||||
.collect::<Vec<_>>(),
|
|
||||||
}),
|
}),
|
||||||
session: Some(polkadot::SessionConfig {
|
session: Some(polkadot::SessionConfig {
|
||||||
keys: initial_authorities.iter().map(|x| (
|
keys: initial_authorities.iter().map(|x| (
|
||||||
@@ -313,7 +311,7 @@ pub fn testnet_genesis(
|
|||||||
changes_trie_config: Default::default(),
|
changes_trie_config: Default::default(),
|
||||||
}),
|
}),
|
||||||
indices: Some(polkadot::IndicesConfig {
|
indices: Some(polkadot::IndicesConfig {
|
||||||
ids: endowed_accounts.clone(),
|
indices: vec![],
|
||||||
}),
|
}),
|
||||||
balances: Some(polkadot::BalancesConfig {
|
balances: Some(polkadot::BalancesConfig {
|
||||||
balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(),
|
balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(),
|
||||||
|
|||||||
@@ -177,9 +177,8 @@ macro_rules! new_full_start {
|
|||||||
import_setup = Some((block_import, grandpa_link, babe_link));
|
import_setup = Some((block_import, grandpa_link, babe_link));
|
||||||
Ok(import_queue)
|
Ok(import_queue)
|
||||||
})?
|
})?
|
||||||
.with_rpc_extensions(|client, pool, _backend, _fetcher, _remote_blockchain|
|
.with_rpc_extensions(|builder| -> Result<polkadot_rpc::RpcExtension, _> {
|
||||||
-> Result<polkadot_rpc::RpcExtension, _> {
|
Ok(polkadot_rpc::create_full(builder.client().clone(), builder.pool()))
|
||||||
Ok(polkadot_rpc::create_full(client, pool))
|
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
(builder, import_setup, inherent_data_providers)
|
(builder, import_setup, inherent_data_providers)
|
||||||
@@ -479,7 +478,6 @@ pub fn new_full<Runtime, Dispatch, Extrinsic>(
|
|||||||
on_exit: service.on_exit(),
|
on_exit: service.on_exit(),
|
||||||
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
|
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
|
||||||
voting_rule: grandpa::VotingRulesBuilder::default().build(),
|
voting_rule: grandpa::VotingRulesBuilder::default().build(),
|
||||||
executor: service.spawn_task_handle(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
service.spawn_essential_task(
|
service.spawn_essential_task(
|
||||||
@@ -626,13 +624,14 @@ where
|
|||||||
.with_finality_proof_provider(|client, backend|
|
.with_finality_proof_provider(|client, backend|
|
||||||
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, client)) as _)
|
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, client)) as _)
|
||||||
)?
|
)?
|
||||||
.with_rpc_extensions(|client, pool, _backend, fetcher, remote_blockchain|
|
.with_rpc_extensions(|builder|
|
||||||
-> Result<polkadot_rpc::RpcExtension, _> {
|
-> Result<polkadot_rpc::RpcExtension, _> {
|
||||||
let fetcher = fetcher
|
let fetcher = builder.fetcher()
|
||||||
.ok_or_else(|| "Trying to start node RPC without active fetcher")?;
|
.ok_or_else(|| "Trying to start node RPC without active fetcher")?;
|
||||||
let remote_blockchain = remote_blockchain
|
let remote_blockchain = builder.remote_backend()
|
||||||
.ok_or_else(|| "Trying to start node RPC without active remote blockchain")?;
|
.ok_or_else(|| "Trying to start node RPC without active remote blockchain")?;
|
||||||
Ok(polkadot_rpc::create_light(client, remote_blockchain, fetcher, pool))
|
|
||||||
|
Ok(polkadot_rpc::create_light(builder.client().clone(), remote_blockchain, fetcher, builder.pool()))
|
||||||
})?
|
})?
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-statement-table"
|
name = "polkadot-statement-table"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "adder"
|
name = "adder"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
description = "Test parachain which adds to a number as its state transition"
|
description = "Test parachain which adds to a number as its state transition"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "halt"
|
name = "halt"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
description = "Test parachain which executes forever"
|
description = "Test parachain which executes forever"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "polkadot-validation"
|
name = "polkadot-validation"
|
||||||
version = "0.7.20"
|
version = "0.7.21"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ impl<Client, TxPool, Backend> CreateProposalData<Client, TxPool, Backend> where
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
match block_builder.push(ready.data().clone()) {
|
match block_builder.push_trusted(ready.data().clone()) {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
debug!("[{:?}] Pushed to the block.", ready.hash());
|
debug!("[{:?}] Pushed to the block.", ready.hash());
|
||||||
pending_size += encoded_size;
|
pending_size += encoded_size;
|
||||||
|
|||||||
Reference in New Issue
Block a user