Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
74bcfcb
comment updates
joepetrowski Mar 6, 2019
a544d4a
Merge branch 'master' into joe-balances-docs
joepetrowski Mar 6, 2019
1cc5721
added rustdoc and readme
joepetrowski Mar 6, 2019
e4a3bf7
clarified LockableCurrency trait
joepetrowski Mar 6, 2019
3e4b5e4
Currency trait rustdocs
joepetrowski Mar 7, 2019
077cde2
fixed typo
joepetrowski Mar 7, 2019
dd16fd6
fixed suggestions round 1
joepetrowski Mar 8, 2019
ceeb172
UpdateBalanceOutcome docs (open for discussion)
joepetrowski Mar 8, 2019
05894ab
rm description of enum, consolidation, rm ReclaimRebate
joepetrowski Mar 9, 2019
a654735
type clarification, examples overhaul, adoc formatting
joepetrowski Mar 10, 2019
02110b2
adoc to md
joepetrowski Mar 11, 2019
53680af
format change for rustdoc
joepetrowski Mar 12, 2019
f1b62a4
update links and fix typos
joepetrowski Mar 12, 2019
499c239
typos and links
joepetrowski Mar 13, 2019
cf750f8
Merge remote-tracking branch 'origin/master' into joe-balances-docs
joepetrowski Mar 13, 2019
2cf4009
updates according to comments
joepetrowski Mar 13, 2019
d863ff6
new example
joepetrowski Mar 14, 2019
5e28748
small clarifications
joepetrowski Mar 14, 2019
c8ec45a
trait implementation section
joepetrowski Mar 14, 2019
36b1689
missing ```
joepetrowski Mar 14, 2019
3c157e4
small changes, ready for review
joepetrowski Mar 14, 2019
a0ef9b7
line width update
joepetrowski Mar 15, 2019
2d28117
Merge branch 'master' into joe-balances-docs
joepetrowski Mar 18, 2019
df3ced9
Merge branch 'master' into joe-balances-docs
joepetrowski Mar 21, 2019
e42f6b6
small tweaks
joepetrowski Mar 25, 2019
e000871
Update srml/balances/src/lib.rs
gui1117 Mar 25, 2019
faccdbf
Update srml/balances/src/lib.rs
gui1117 Mar 25, 2019
513b377
Update srml/balances/src/lib.rs
gui1117 Mar 25, 2019
ce29349
Update srml/balances/src/lib.rs
gui1117 Mar 25, 2019
fa9f215
Update lib.rs
joepetrowski Mar 25, 2019
28a1d33
address review by thiolliere
joepetrowski Mar 25, 2019
aa43b56
remove common warning
joepetrowski Mar 26, 2019
191ecc0
Merge remote-tracking branch 'origin/master' into joe-balances-docs
gavofyork Mar 26, 2019
665fa6b
Update docs
gavofyork Mar 26, 2019
5f391ae
updated srml example
joepetrowski Mar 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
UpdateBalanceOutcome docs (open for discussion)
  • Loading branch information
joepetrowski committed Mar 8, 2019
commit ceeb17285e67f832e8a1b31d6a8bcea6335f2d83
9 changes: 3 additions & 6 deletions srml/balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ impl<T: Trait> Module<T> {
/// Doesn't do any preparatory work for creating a new account, so should only be used when it
/// is known that the account already exists.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to have a standardized preconditions documentation section, many method here have preconditions that have to be meet in order to ensure consistency.

///
/// Returns `Updated` if the account was successfully updated
/// or `AccountKilled` if the update has led to killing the account.
/// Return indicates whether the account has been updated or if the update has led to killing the account.
pub fn set_reserved_balance(who: &T::AccountId, balance: T::Balance) -> UpdateBalanceOutcome {
if balance < Self::existential_deposit() {
<ReservedBalance<T>>::insert(who, balance);
Expand All @@ -250,8 +249,7 @@ impl<T: Trait> Module<T> {
/// Doesn't do any preparatory work for creating a new account, so should only be used when it
/// is known that the account already exists.
///
/// Returns `Updated` if the account was successfully updated
/// or `AccountKilled` if the update has led to killing the account.
/// Return indicates whether the account has been updated or if the update has led to killing the account.
pub fn set_free_balance(who: &T::AccountId, balance: T::Balance) -> UpdateBalanceOutcome {
// Commented out for now - but consider it instructive.
// assert!(!Self::total_balance(who).is_zero());
Expand All @@ -270,8 +268,7 @@ impl<T: Trait> Module<T> {
///
/// Same as `set_free_balance`, but will create a new account.
///
/// Returns `Updated` if the account was successfully updated
/// or `AccountKilled` if the update has led to killing the account.
/// Return indicates whether the account has been updated or if the update has led to killing the account.
pub fn set_free_balance_creating(who: &T::AccountId, balance: T::Balance) -> UpdateBalanceOutcome {
let ed = <Module<T>>::existential_deposit();
// If the balance is too low, then the account is reaped.
Expand Down
3 changes: 1 addition & 2 deletions srml/support/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ pub trait Currency<AccountId> {
///
/// If `who` doesn't exist, it is created
///
/// Returns `Updated` if the account was successfully updated
/// or `AccountKilled` if the update has led to killing the account.
/// Return indicates whether the account has been updated or if the update has led to killing the account.
///
/// #NOTES
///
Expand Down