Relocate weight to paint + decouple from extensions (#4124)

* Fisr migrated version of weight to paint

* Bump

* Minor nits

* Some review fixes.

* Line width

* Revert spec bump

* Fix build

* Update lock file

* Update palette/executive/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update palette/membership/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Kian Paimani
2019-11-22 11:23:32 +01:00
committed by GitHub
parent 8185ee925d
commit 11703a5916
40 changed files with 246 additions and 170 deletions
+10 -5
View File
@@ -77,9 +77,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
use rstd::{prelude::*, marker::PhantomData};
use support::weights::{GetDispatchInfo, WeighBlock, DispatchInfo};
use sr_primitives::{
generic::Digest, ApplyResult,
weights::{GetDispatchInfo, WeighBlock},
traits::{
self, Header, Zero, One, Checkable, Applyable, CheckEqual, OnFinalize, OnInitialize,
NumberFor, Block as BlockT, OffchainWorker, Dispatchable,
@@ -119,7 +119,9 @@ impl<
> ExecuteBlock<Block> for Executive<System, Block, Context, UnsignedValidator, AllModules>
where
Block::Extrinsic: Checkable<Context> + Codec,
CheckedOf<Block::Extrinsic, Context>: Applyable<AccountId=System::AccountId> + GetDispatchInfo,
CheckedOf<Block::Extrinsic, Context>:
Applyable<AccountId=System::AccountId, DispatchInfo=DispatchInfo> +
GetDispatchInfo,
CallOf<Block::Extrinsic, Context>: Dispatchable,
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call=CallOf<Block::Extrinsic, Context>>,
@@ -143,7 +145,9 @@ impl<
> Executive<System, Block, Context, UnsignedValidator, AllModules>
where
Block::Extrinsic: Checkable<Context> + Codec,
CheckedOf<Block::Extrinsic, Context>: Applyable<AccountId=System::AccountId> + GetDispatchInfo,
CheckedOf<Block::Extrinsic, Context>:
Applyable<AccountId=System::AccountId, DispatchInfo=DispatchInfo> +
GetDispatchInfo,
CallOf<Block::Extrinsic, Context>: Dispatchable,
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call=CallOf<Block::Extrinsic, Context>>,
@@ -316,12 +320,13 @@ mod tests {
use super::*;
use primitives::H256;
use sr_primitives::{
generic::Era, Perbill, DispatchError, weights::Weight, testing::{Digest, Header, Block},
generic::Era, Perbill, DispatchError, testing::{Digest, Header, Block},
traits::{Bounded, Header as HeaderT, BlakeTwo256, IdentityLookup, ConvertInto},
transaction_validity::{InvalidTransaction, UnknownTransaction}, ApplyError,
};
use support::{
impl_outer_event, impl_outer_origin, parameter_types, impl_outer_dispatch,
weights::Weight,
traits::{Currency, LockIdentifier, LockableCurrency, WithdrawReasons, WithdrawReason},
};
use system::{Call as SystemCall, ChainContext};
@@ -329,7 +334,7 @@ mod tests {
use hex_literal::hex;
mod custom {
use sr_primitives::weights::SimpleDispatchInfo;
use support::weights::SimpleDispatchInfo;
pub trait Trait: system::Trait {}