From d717181960a1c8f631ccc774c76a9abf109eefc7 Mon Sep 17 00:00:00 2001
From: Hugo Trentesaux <hugo@trentesaux.fr>
Date: Wed, 17 Jan 2024 13:10:08 +0100
Subject: [PATCH] add missing constant annotation

and update doc
---
 pallets/membership/README.md          |  18 +-----------------
 pallets/membership/src/lib.rs         |   3 ++-
 pallets/universal-dividend/src/lib.rs |  10 +++++-----
 resources/metadata.scale              | Bin 128356 -> 128437 bytes
 4 files changed, 8 insertions(+), 23 deletions(-)

diff --git a/pallets/membership/README.md b/pallets/membership/README.md
index 4bcd6020f..c6dc0da83 100644
--- a/pallets/membership/README.md
+++ b/pallets/membership/README.md
@@ -4,20 +4,4 @@ Duniter membership is related to duniter Web of Trust and more specific than [pa
 
 ## Main Web of Trust
 
-When used in conjunction with the main Web of Trust, the membership pallet is combined with the Duniter-WoT pallet and the identity pallet, resulting in the following functionality:
-
-- `claim_membership` requires enough certifications, and a valid distance
-- `renew_membership` requires a valid membership and a valid distance status to extend the validity period of a membership.
-- `revoke_membership` (to be removed?)
-
-In practice, a new user creates an account, confirms identity using the `confirm_identity` call from the identity pallet. The user then validates its identity using `claim_membership`. If the certification and distance requirements are met, the identity is granted membership.
-
-## Sub Web of Trust Smith
-
-Functionality related to the Smith Web of Trust involves the following:
-
-- `claim_membership` requires to be member of the main wot and have enough smith certifications
-- `renew_membership` needs a valid membership to extend the membership's validity period.
-- `revoke_membership` requires a valid origin to revoke the membership.
-
-In practice, a user must complete all steps to gain membership in the main Web Of Trust. They can call `claim_membership` to be added to the authority members.
+Membership pallet manages all events related to web of trust membership of an identity. It exposes no calls to the user and its features are only available trough distance evaluation provided by distance oracle.
diff --git a/pallets/membership/src/lib.rs b/pallets/membership/src/lib.rs
index 36884fba8..f0c463750 100644
--- a/pallets/membership/src/lib.rs
+++ b/pallets/membership/src/lib.rs
@@ -91,12 +91,13 @@ pub mod pallet {
         type IdtyIdOf: Convert<Self::AccountId, Option<Self::IdtyId>>;
         /// Something that gives the AccountId of an IdtyId
         type AccountIdOf: Convert<Self::IdtyId, Option<Self::AccountId>>;
-        #[pallet::constant]
         /// Maximum life span of a single membership (in number of blocks)
         // (this could be renamed "validity" or "duration")
+        #[pallet::constant]
         type MembershipPeriod: Get<Self::BlockNumber>;
         /// Minimum delay to wait before renewing membership
         // i.e. asking for distance evaluation
+        #[pallet::constant]
         type MembershipRenewalPeriod: Get<Self::BlockNumber>;
         /// On event handler
         type OnEvent: OnEvent<Self::IdtyId>;
diff --git a/pallets/universal-dividend/src/lib.rs b/pallets/universal-dividend/src/lib.rs
index 92ae7c7df..b52482709 100644
--- a/pallets/universal-dividend/src/lib.rs
+++ b/pallets/universal-dividend/src/lib.rs
@@ -61,8 +61,8 @@ pub mod pallet {
         type MomentIntoBalance: Convert<Self::Moment, BalanceOf<Self>>;
         // The currency
         type Currency: Currency<Self::AccountId>;
-        #[pallet::constant]
         /// Maximum number of past UD revaluations to keep in storage.
+        #[pallet::constant]
         type MaxPastReeval: Get<u32>;
         /// Somethings that must provide the number of accounts allowed to create the universal dividend
         type MembersCount: Get<BalanceOf<Self>>;
@@ -70,19 +70,19 @@ pub mod pallet {
         type MembersStorage: frame_support::traits::StoredMap<Self::AccountId, FirstEligibleUd>;
         /// Because this pallet emits events, it depends on the runtime's definition of an event.
         type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
-        #[pallet::constant]
         /// Square of the money growth rate per ud reevaluation period
-        type SquareMoneyGrowthRate: Get<Perbill>;
         #[pallet::constant]
+        type SquareMoneyGrowthRate: Get<Perbill>;
         /// Universal dividend creation period (ms)
-        type UdCreationPeriod: Get<Self::Moment>;
         #[pallet::constant]
+        type UdCreationPeriod: Get<Self::Moment>;
         /// Universal dividend reevaluation period (ms)
-        type UdReevalPeriod: Get<Self::Moment>;
         #[pallet::constant]
+        type UdReevalPeriod: Get<Self::Moment>;
         /// The number of units to divide the amounts expressed in number of UDs
         /// Example: If you wish to express the UD amounts with a maximum precision of the order
         /// of the milliUD, choose 1000
+        #[pallet::constant]
         type UnitsPerUd: Get<BalanceOf<Self>>;
         /// Pallet weights info
         type WeightInfo: WeightInfo;
diff --git a/resources/metadata.scale b/resources/metadata.scale
index 4f75555d61b51bfad4efd4f2d66048694ccefb78..9c20a389c719ccedf73e8456078a50778a2675e3 100644
GIT binary patch
delta 89
zcmaFzihb*A_J%EtXYVp{Oh0#*F@iB>`u|8qaZ3S#7t9O{EJqZ4GxIWYOLG-cQgae3
u6-x3I$`dn76p~WY@{3Xxic<4Z%QN%R6>?K^lTwR{GcpUdtKDO?69)h;pCRG^

delta 24
gcmdn`n*GTu_J%EtXYVqyOh0#*F=Bi9Jw`im0G$g9UH||9

-- 
GitLab