Skip to content
Snippets Groups Projects
Commit d7171819 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

add missing constant annotation

and update doc
parent bb66ea24
No related branches found
No related tags found
1 merge request!219automatically claim membership
Pipeline #35389 failed
...@@ -4,20 +4,4 @@ Duniter membership is related to duniter Web of Trust and more specific than [pa ...@@ -4,20 +4,4 @@ Duniter membership is related to duniter Web of Trust and more specific than [pa
## Main Web of Trust ## 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: 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.
- `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.
...@@ -91,12 +91,13 @@ pub mod pallet { ...@@ -91,12 +91,13 @@ pub mod pallet {
type IdtyIdOf: Convert<Self::AccountId, Option<Self::IdtyId>>; type IdtyIdOf: Convert<Self::AccountId, Option<Self::IdtyId>>;
/// Something that gives the AccountId of an IdtyId /// Something that gives the AccountId of an IdtyId
type AccountIdOf: Convert<Self::IdtyId, Option<Self::AccountId>>; type AccountIdOf: Convert<Self::IdtyId, Option<Self::AccountId>>;
#[pallet::constant]
/// Maximum life span of a single membership (in number of blocks) /// Maximum life span of a single membership (in number of blocks)
// (this could be renamed "validity" or "duration") // (this could be renamed "validity" or "duration")
#[pallet::constant]
type MembershipPeriod: Get<Self::BlockNumber>; type MembershipPeriod: Get<Self::BlockNumber>;
/// Minimum delay to wait before renewing membership /// Minimum delay to wait before renewing membership
// i.e. asking for distance evaluation // i.e. asking for distance evaluation
#[pallet::constant]
type MembershipRenewalPeriod: Get<Self::BlockNumber>; type MembershipRenewalPeriod: Get<Self::BlockNumber>;
/// On event handler /// On event handler
type OnEvent: OnEvent<Self::IdtyId>; type OnEvent: OnEvent<Self::IdtyId>;
......
...@@ -61,8 +61,8 @@ pub mod pallet { ...@@ -61,8 +61,8 @@ pub mod pallet {
type MomentIntoBalance: Convert<Self::Moment, BalanceOf<Self>>; type MomentIntoBalance: Convert<Self::Moment, BalanceOf<Self>>;
// The currency // The currency
type Currency: Currency<Self::AccountId>; type Currency: Currency<Self::AccountId>;
#[pallet::constant]
/// Maximum number of past UD revaluations to keep in storage. /// Maximum number of past UD revaluations to keep in storage.
#[pallet::constant]
type MaxPastReeval: Get<u32>; type MaxPastReeval: Get<u32>;
/// Somethings that must provide the number of accounts allowed to create the universal dividend /// Somethings that must provide the number of accounts allowed to create the universal dividend
type MembersCount: Get<BalanceOf<Self>>; type MembersCount: Get<BalanceOf<Self>>;
...@@ -70,19 +70,19 @@ pub mod pallet { ...@@ -70,19 +70,19 @@ pub mod pallet {
type MembersStorage: frame_support::traits::StoredMap<Self::AccountId, FirstEligibleUd>; type MembersStorage: frame_support::traits::StoredMap<Self::AccountId, FirstEligibleUd>;
/// Because this pallet emits events, it depends on the runtime's definition of an event. /// 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>; type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
#[pallet::constant]
/// Square of the money growth rate per ud reevaluation period /// Square of the money growth rate per ud reevaluation period
type SquareMoneyGrowthRate: Get<Perbill>;
#[pallet::constant] #[pallet::constant]
type SquareMoneyGrowthRate: Get<Perbill>;
/// Universal dividend creation period (ms) /// Universal dividend creation period (ms)
type UdCreationPeriod: Get<Self::Moment>;
#[pallet::constant] #[pallet::constant]
type UdCreationPeriod: Get<Self::Moment>;
/// Universal dividend reevaluation period (ms) /// Universal dividend reevaluation period (ms)
type UdReevalPeriod: Get<Self::Moment>;
#[pallet::constant] #[pallet::constant]
type UdReevalPeriod: Get<Self::Moment>;
/// The number of units to divide the amounts expressed in number of UDs /// 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 /// Example: If you wish to express the UD amounts with a maximum precision of the order
/// of the milliUD, choose 1000 /// of the milliUD, choose 1000
#[pallet::constant]
type UnitsPerUd: Get<BalanceOf<Self>>; type UnitsPerUd: Get<BalanceOf<Self>>;
/// Pallet weights info /// Pallet weights info
type WeightInfo: WeightInfo; type WeightInfo: WeightInfo;
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment