Add ExistenceRequirement to Currency trait (#4000)

* Added a public transfer_some function and a private transfer_inner fn

* Move transfer_some to the end of the module impl to fix failing contracts test

* Change whitespace

* Remove needless change to transfer logic

* Fix error

* Update srml/balances/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Improve documentation and add test

* Update srml/balances/src/lib.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Switch to changing Currency trait instead
This commit is contained in:
Ashley
2019-11-07 11:01:47 +00:00
committed by Gavin Wood
parent e73436d818
commit 3a7b1b9da5
4 changed files with 76 additions and 25 deletions
+6 -1
View File
@@ -1096,7 +1096,12 @@ where
Zero::zero()
}
fn transfer(transactor: &T::AccountId, dest: &T::AccountId, value: Self::Balance) -> Result {
fn transfer(
transactor: &T::AccountId,
dest: &T::AccountId,
value: Self::Balance,
_: ExistenceRequirement, // no existential deposit policy for generic asset
) -> Result {
<Module<T>>::make_transfer(&U::asset_id(), transactor, dest, value)
}