From 5f50b70466d9e8527af07b2a99ada533c299f902 Mon Sep 17 00:00:00 2001
From: Xiliang Chen <xlchen1291@gmail.com>
Date: Thu, 5 Mar 2020 15:42:11 +1300
Subject: [PATCH] Vesting module documentation (#109)

* Add vesting documentations.

* Add vesting module README.

* Fix type.
---
 vesting/README.md  |  9 +++++++++
 vesting/src/lib.rs | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 vesting/README.md

diff --git a/vesting/README.md b/vesting/README.md
new file mode 100644
index 0000000..6f44ec2
--- /dev/null
+++ b/vesting/README.md
@@ -0,0 +1,9 @@
+# Vesting Module
+
+## Overview
+
+Vesting module provides a means of scheduled balance lock on an account. It uses the *graded vesting* way, which unlocks a specific amount of balance every period of time, until all balance unlocked.
+
+### Vesting Schedule
+
+The schedule of a vesting is described by data structure `VestingSchedule`: from the block number of `start`, for every `period` amount of blocks, `per_period` amount of balance would unlocked, until number of periods `period_count` reached. Note in vesting schedules, *time* is measured by block number. All `VestingSchedule`s under an account could be queried in chain state.
diff --git a/vesting/src/lib.rs b/vesting/src/lib.rs
index c080592..38aad90 100644
--- a/vesting/src/lib.rs
+++ b/vesting/src/lib.rs
@@ -1,3 +1,25 @@
+//! # Vesting Module
+//!
+//! ## Overview
+//!
+//! Vesting module provides a means of scheduled balance lock on an account. It uses the *graded vesting* way, which
+//! unlocks a specific amount of balance every period of time, until all balance unlocked.
+//!
+//! ### Vesting Schedule
+//!
+//! The schedule of a vesting is described by data structure `VestingSchedule`: from the block number of `start`, for
+//! every `period` amount of blocks, `per_period` amount of balance would unlocked, until number of periods
+//! `period_count` reached. Note in vesting schedules, *time* is measured by block number. All `VestingSchedule`s under
+//! an account could be queried in chain state.
+//!
+//! ## Interface
+//!
+//! ### Dispatchable Functions
+//!
+//! - `add_vesting_schedule` - Add a new vesting schedule for an account.
+//! - `claim` - Claim unlocked balances.
+//! - `update_vesting_schedules` - Update all vesting schedules under an account, `root` origin required.
+
 #![cfg_attr(not(feature = "std"), no_std)]
 
 use codec::{Decode, Encode, HasCompact};
-- 
GitLab