Skip to content
Snippets Groups Projects
Commit 040f7b17 authored by Mildred Ki'Lya's avatar Mildred Ki'Lya
Browse files

Remove RevokedMembership that is always empty

parent fbce116a
No related branches found
No related tags found
1 merge request!94Remove RevocationPeriod rule
This commit is part of merge request !94. Comments created here will be created in the context of that merge request.
...@@ -131,11 +131,6 @@ pub mod pallet { ...@@ -131,11 +131,6 @@ pub mod pallet {
pub type PendingMembershipsExpireOn<T: Config<I>, I: 'static = ()> = pub type PendingMembershipsExpireOn<T: Config<I>, I: 'static = ()> =
StorageMap<_, Twox64Concat, T::BlockNumber, Vec<T::IdtyId>, ValueQuery>; StorageMap<_, Twox64Concat, T::BlockNumber, Vec<T::IdtyId>, ValueQuery>;
#[pallet::storage]
#[pallet::getter(fn revoked_membership)]
pub type RevokedMembership<T: Config<I>, I: 'static = ()> =
StorageMap<_, Twox64Concat, T::IdtyId, (), OptionQuery>;
#[pallet::storage] #[pallet::storage]
#[pallet::getter(fn revoked_memberships_pruned_on)] #[pallet::getter(fn revoked_memberships_pruned_on)]
pub type RevokedMembershipsPrunedOn<T: Config<I>, I: 'static = ()> = pub type RevokedMembershipsPrunedOn<T: Config<I>, I: 'static = ()> =
...@@ -337,9 +332,6 @@ pub mod pallet { ...@@ -337,9 +332,6 @@ pub mod pallet {
if Membership::<T, I>::contains_key(&idty_id) { if Membership::<T, I>::contains_key(&idty_id) {
return Err(Error::<T, I>::MembershipAlreadyAcquired.into()); return Err(Error::<T, I>::MembershipAlreadyAcquired.into());
} }
if RevokedMembership::<T, I>::contains_key(&idty_id) {
return Err(Error::<T, I>::MembershipRevokedRecently.into());
}
let block_number = frame_system::pallet::Pallet::<T>::block_number(); let block_number = frame_system::pallet::Pallet::<T>::block_number();
let expire_on = block_number + T::PendingMembershipPeriod::get(); let expire_on = block_number + T::PendingMembershipPeriod::get();
...@@ -405,12 +397,6 @@ pub mod pallet { ...@@ -405,12 +397,6 @@ pub mod pallet {
fn prune_revoked_memberships(block_number: T::BlockNumber) -> Weight { fn prune_revoked_memberships(block_number: T::BlockNumber) -> Weight {
let total_weight: Weight = 0; let total_weight: Weight = 0;
if let Some(identities_ids) = RevokedMembershipsPrunedOn::<T, I>::take(block_number) {
for idty_id in identities_ids {
RevokedMembership::<T, I>::remove(idty_id);
}
}
total_weight total_weight
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment