Update for Substrate master (#600)

* update substrate for change to palette

* change paint to palette

* update lock

* Fix missing import

* change to polkadot-master

* Use same commit hash of parity-common

* Resolve linking errors

* Rename to frame

* bump spec

* Subsume #602 and #596

* Fix DispatchInfo

* Merge `futures03` and `joe-update-to-palette` (#606)

* Change repo and branch

* Made changes

* Bumped async-std version

* Fix line width

* Bump spec_version

* Fix `run_to_block` for Crowdfund module (#603)

Probably a copy paste error.

* Bump dependencies

* Update trie-db to be inline with substrate

* Fix documentation warning

* Fix test compilation
This commit is contained in:
joe petrowski
2019-11-23 00:16:04 +01:00
committed by Gavin Wood
parent e229074f79
commit c9b1e3d959
27 changed files with 1310 additions and 925 deletions
+1 -1
View File
@@ -21,7 +21,7 @@
use rstd::prelude::*;
use codec::{Encode, Decode};
use paint_support::{decl_storage, decl_module, ensure, dispatch::Result, traits::Get};
use frame_support::{decl_storage, decl_module, ensure, dispatch::Result, traits::Get};
use primitives::{Hash, parachain::{AttestedCandidate, CandidateReceipt, Id as ParaId}};
use sr_primitives::RuntimeDebug;
+5 -4
View File
@@ -18,8 +18,9 @@
use rstd::prelude::*;
use sr_io::{hashing::keccak_256, crypto::secp256k1_ecdsa_recover};
use paint_support::{decl_event, decl_storage, decl_module};
use paint_support::traits::{Currency, Get};
use frame_support::{decl_event, decl_storage, decl_module};
use frame_support::weights::SimpleDispatchInfo;
use frame_support::traits::{Currency, Get};
use system::{ensure_root, ensure_none};
use codec::{Encode, Decode};
#[cfg(feature = "std")]
@@ -27,7 +28,7 @@ use serde::{self, Serialize, Deserialize, Serializer, Deserializer};
#[cfg(feature = "std")]
use sr_primitives::traits::Zero;
use sr_primitives::{
RuntimeDebug, weights::SimpleDispatchInfo, transaction_validity::{
RuntimeDebug, transaction_validity::{
TransactionLongevity, TransactionValidity, ValidTransaction, InvalidTransaction
},
};
@@ -249,7 +250,7 @@ mod tests {
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sr_primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
use balances;
use paint_support::{impl_outer_origin, assert_ok, assert_err, assert_noop, parameter_types};
use frame_support::{impl_outer_origin, assert_ok, assert_err, assert_noop, parameter_types};
impl_outer_origin! {
pub enum Origin for Test {}
+4 -3
View File
@@ -66,15 +66,16 @@
//! order to win a later auction, then it is the parachain's duty to ensure that the right amount of
//! funds ultimately end up in module's fund sub-account.
use paint_support::{
use frame_support::{
decl_module, decl_storage, decl_event, storage::child, ensure, traits::{
Currency, Get, OnUnbalanced, WithdrawReason, ExistenceRequirement::AllowDeath
}
};
use system::ensure_signed;
use sr_primitives::{ModuleId, weights::SimpleDispatchInfo,
use sr_primitives::{ModuleId,
traits::{AccountIdConversion, Hash, Saturating, Zero, CheckedAdd}
};
use frame_support::weights::SimpleDispatchInfo;
use crate::slots;
use codec::{Encode, Decode};
use rstd::vec::Vec;
@@ -489,7 +490,7 @@ mod tests {
use super::*;
use std::{collections::HashMap, cell::RefCell};
use paint_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types};
use frame_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types};
use substrate_primitives::H256;
use primitives::parachain::{Info as ParaInfo, Id as ParaId};
// The testing primitives are very useful for avoiding having to work with signatures
+2 -2
View File
@@ -17,10 +17,10 @@
//! Auxillary struct/enums for polkadot runtime.
use primitives::Balance;
use sr_primitives::weights::Weight;
use sr_primitives::traits::{Convert, Saturating};
use sr_primitives::{Fixed64, Perbill};
use paint_support::traits::{OnUnbalanced, Currency, Get};
use frame_support::weights::Weight;
use frame_support::traits::{OnUnbalanced, Currency, Get};
use crate::{Balances, System, Authorship, MaximumBlockWeight, NegativeImbalance};
/// Logic for the author to get a portion of fees.
+14 -10
View File
@@ -37,9 +37,9 @@ use primitives::{
};
use sr_primitives::{
create_runtime_str, generic, impl_opaque_keys,
ApplyResult, Permill, Perbill, RuntimeDebug,
ApplyExtrinsicResult, Permill, Perbill, RuntimeDebug,
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
weights::{Weight, DispatchInfo}, curve::PiecewiseLinear,
curve::PiecewiseLinear,
traits::{BlakeTwo256, Block as BlockT, StaticLookup, SignedExtension, OpaqueKeys},
};
use version::RuntimeVersion;
@@ -48,12 +48,13 @@ use grandpa::{AuthorityId as GrandpaId, fg_primitives};
use version::NativeVersion;
use substrate_primitives::OpaqueMetadata;
use sr_staking_primitives::SessionIndex;
use paint_support::{
parameter_types, construct_runtime, traits::{SplitTwoWays, Currency, Randomness}
use frame_support::{
parameter_types, construct_runtime, traits::{SplitTwoWays, Currency, Randomness},
weights::{Weight, DispatchInfo},
};
use im_online::sr25519::AuthorityId as ImOnlineId;
use system::offchain::TransactionSubmitter;
use paint_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
#[cfg(feature = "std")]
pub use staking::StakerStatus;
@@ -94,8 +95,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 1,
spec_version: 1018,
authoring_version: 2,
spec_version: 1019,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
};
@@ -120,7 +121,10 @@ impl SignedExtension for OnlyStakingAndClaims {
type Call = Call;
type AdditionalSigned = ();
type Pre = ();
type DispatchInfo = DispatchInfo;
fn additional_signed(&self) -> rstd::result::Result<(), TransactionValidityError> { Ok(()) }
fn validate(&self, _: &Self::AccountId, call: &Self::Call, _: DispatchInfo, _: usize)
-> TransactionValidity
{
@@ -278,7 +282,7 @@ impl session::historical::Trait for Runtime {
type FullIdentificationOf = staking::ExposureOf<Runtime>;
}
paint_staking_reward_curve::build! {
pallet_staking_reward_curve::build! {
const REWARD_CURVE: PiecewiseLinear<'static> = curve!(
min_inflation: 0_025_000,
max_inflation: 0_100_000,
@@ -643,7 +647,7 @@ sr_api::impl_runtime_apis! {
}
impl block_builder_api::BlockBuilder<Block> for Runtime {
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyResult {
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
Executive::apply_extrinsic(extrinsic)
}
@@ -738,7 +742,7 @@ sr_api::impl_runtime_apis! {
}
}
impl paint_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
Block,
Balance,
UncheckedExtrinsic,
+5 -5
View File
@@ -25,7 +25,7 @@ use sr_primitives::traits::{
Hash as HashT, BlakeTwo256, Saturating, One, Zero, Dispatchable,
AccountIdConversion,
};
use sr_primitives::weights::SimpleDispatchInfo;
use frame_support::weights::SimpleDispatchInfo;
use primitives::{
Hash, Balance,
parachain::{
@@ -33,7 +33,7 @@ use primitives::{
UpwardMessage, BlockIngressRoots, ValidatorId, ActiveParas, CollatorId, Retriable
},
};
use paint_support::{
use frame_support::{
Parameter, dispatch::Result, decl_storage, decl_module, ensure,
traits::{Currency, Get, WithdrawReason, ExistenceRequirement, Randomness},
};
@@ -917,7 +917,7 @@ mod tests {
};
use crate::constants::time::*;
use keyring::Sr25519Keyring;
use paint_support::{
use frame_support::{
impl_outer_origin, impl_outer_dispatch, assert_ok, assert_err, parameter_types,
};
use crate::parachains;
@@ -1026,7 +1026,7 @@ mod tests {
type CreationFee = CreationFee;
}
paint_staking_reward_curve::build! {
pallet_staking_reward_curve::build! {
const REWARD_CURVE: PiecewiseLinear<'static> = curve!(
min_inflation: 0_025_000,
max_inflation: 0_100_000,
@@ -2035,7 +2035,7 @@ mod tests {
#[test]
fn empty_trie_root_const_is_blake2_hashed_null_node() {
let hashed_null_node = <NodeCodec<Blake2Hasher> as trie_db::NodeCodec<Blake2Hasher>>::hashed_null_node();
let hashed_null_node = <NodeCodec<Blake2Hasher> as trie_db::NodeCodec>::hashed_null_node();
assert_eq!(hashed_null_node, EMPTY_TRIE_ROOT.into())
}
}
+5 -4
View File
@@ -24,14 +24,14 @@ use rstd::marker::PhantomData;
use codec::{Encode, Decode};
use sr_primitives::{
weights::{SimpleDispatchInfo, DispatchInfo},
transaction_validity::{TransactionValidityError, ValidTransaction, TransactionValidity},
traits::{Hash as HashT, SignedExtension}
};
use paint_support::{
use frame_support::{
decl_storage, decl_module, decl_event, ensure,
dispatch::{Result, IsSubType}, traits::{Get, Currency, ReservableCurrency}
dispatch::{Result, IsSubType}, traits::{Get, Currency, ReservableCurrency},
weights::{SimpleDispatchInfo, DispatchInfo},
};
use system::{self, ensure_root, ensure_signed};
use primitives::parachain::{
@@ -508,6 +508,7 @@ impl<T: Trait + Send + Sync> SignedExtension for LimitParathreadCommits<T> where
type Call = <T as system::Trait>::Call;
type AdditionalSigned = ();
type Pre = ();
type DispatchInfo = DispatchInfo;
fn additional_signed(&self)
-> rstd::result::Result<Self::AdditionalSigned, TransactionValidityError>
@@ -588,7 +589,7 @@ mod tests {
},
Balance, BlockNumber,
};
use paint_support::{
use frame_support::{
impl_outer_origin, impl_outer_dispatch, assert_ok, parameter_types, assert_noop,
};
use keyring::Sr25519Keyring;
+3 -3
View File
@@ -22,9 +22,9 @@ use rstd::{prelude::*, mem::swap, convert::TryInto};
use sr_primitives::traits::{
CheckedSub, StaticLookup, Zero, One, CheckedConversion, Hash, AccountIdConversion,
};
use sr_primitives::weights::SimpleDispatchInfo;
use frame_support::weights::SimpleDispatchInfo;
use codec::{Encode, Decode, Codec};
use paint_support::{
use frame_support::{
decl_module, decl_storage, decl_event, ensure,
traits::{Currency, ReservableCurrency, WithdrawReason, ExistenceRequirement, Get, Randomness},
};
@@ -825,7 +825,7 @@ mod tests {
Perbill, testing::Header,
traits::{BlakeTwo256, Hash, IdentityLookup, OnInitialize, OnFinalize},
};
use paint_support::{impl_outer_origin, parameter_types, assert_ok, assert_noop};
use frame_support::{impl_outer_origin, parameter_types, assert_ok, assert_noop};
use balances;
use primitives::parachain::{Id as ParaId, Info as ParaInfo};