fix and test default instance for collective (#3135)

This commit is contained in:
thiolliere
2019-07-17 19:00:20 +02:00
committed by GitHub
parent eea9437805
commit 62f62c6c48
2 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 113,
impl_version: 113,
impl_version: 114,
apis: RUNTIME_API_VERSIONS,
};
+9 -5
View File
@@ -62,7 +62,7 @@ pub enum RawOrigin<AccountId, I> {
}
/// Origin for the collective module.
pub type Origin<T, I> = RawOrigin<<T as system::Trait>::AccountId, I>;
pub type Origin<T, I=DefaultInstance> = RawOrigin<<T as system::Trait>::AccountId, I>;
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Debug))]
@@ -97,13 +97,10 @@ decl_storage! {
}
decl_event!(
pub enum Event<T, I> where
pub enum Event<T, I=DefaultInstance> where
<T as system::Trait>::Hash,
<T as system::Trait>::AccountId,
Phantom = rstd::marker::PhantomData<T>
{
/// Dummy to manage the fact we have instancing.
_Phantom(Phantom),
/// A motion (given hash) has been proposed (by given account) with a threshold (given
/// `MemberCount`).
Proposed(AccountId, ProposalIndex, Hash, MemberCount),
@@ -420,6 +417,11 @@ mod tests {
type Proposal = Call;
type Event = Event;
}
impl Trait for Test {
type Origin = Origin;
type Proposal = Call;
type Event = Event;
}
pub type Block = primitives::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = primitives::generic::UncheckedMortalCompactExtrinsic<u32, u64, Call, ()>;
@@ -432,6 +434,7 @@ mod tests {
{
System: system::{Module, Call, Event},
Collective: collective::<Instance1>::{Module, Call, Event<T>, Origin<T>, Config<T>},
DefaultCollective: collective::{Module, Call, Event<T>, Origin<T>, Config<T>},
}
);
@@ -441,6 +444,7 @@ mod tests {
members: vec![1, 2, 3],
phantom: Default::default(),
}),
collective: None,
}.build_storage().unwrap().0.into()
}