From 503f004388e19e78449d45169c807af718c1fd20 Mon Sep 17 00:00:00 2001 From: Joseph Knecht <83087510+JosephKnecht-lab@users.noreply.github.com> Date: Wed, 2 Mar 2022 11:48:55 +0100 Subject: [PATCH] refactor vision signer --- dao/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dao/src/lib.rs b/dao/src/lib.rs index 7b50a13..a4a805c 100644 --- a/dao/src/lib.rs +++ b/dao/src/lib.rs @@ -148,9 +148,9 @@ pub mod pallet { #[pallet::storage] - #[pallet::getter(fn vision_signer)] + #[pallet::getter(fn applicants_to_organization)] /// Storage Map to indicate which user agree with a proposed Vision [Vision, Vec[Account]] - pub(super) type VisionSigner = StorageMap<_, Twox64Concat, Vec, Vec, ValueQuery>; + pub(super) type ApplicantsToOrganization = StorageMap<_, Twox64Concat, Vec, Vec, ValueQuery>; #[pallet::event] @@ -541,14 +541,14 @@ pub mod pallet { // TODO: Perhaps use vision Hash instead of vision document // let hash_vision = T::Hashing::hash_of(&vision_document); - let mut members = >::vision_signer(vision_document); + let mut members = >::applicants_to_organization(vision_document); // Ensure not signed already ensure!(!members.contains(from_initiator), >::AlreadySigned); members.push(from_initiator.clone()); // Update storage. - >::insert(vision_document, members); + >::insert(vision_document, members); Ok(()) } @@ -561,14 +561,14 @@ pub mod pallet { // TODO: Perhaps use vision Hash instead of vision document // let hash_vision = T::Hashing::hash_of(&vision_document); - let mut members = >::vision_signer(vision_document); + let mut members = >::applicants_to_organization(vision_document); // Ensure not signed already let index = members.binary_search(from_initiator).ok().ok_or(>::NotSigned)?; members.remove(index); // Update storage. - >::insert(vision_document, members); + >::insert(vision_document, members); Ok(()) }