Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transfer_all to Currencies #379

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mzxyz
Copy link

@mzxyz mzxyz commented Feb 22, 2021

Changes:

  • Add transfer_all to currencies
  • Add test for transfer_all

Not fully understand the requirements for # 375, for tokens module there has already have transfer_all function.

Further steps:

  • Need to generate correct weight for transfer_all_non_native_currency

) -> DispatchResultWithPostInfo {
let from = ensure_signed(origin)?;
let to = T::Lookup::lookup(dest)?;
let balance = <Self as MultiCurrency<T::AccountId>>::free_balance(currency_id, &from);
Copy link
Member

Choose a reason for hiding this comment

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

this needs to be free - frozen

Copy link
Author

Choose a reason for hiding this comment

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

Do you mean apply this for transfer_all in token module as we only define it in orml-tokens

@xlc
Copy link
Member

xlc commented Feb 22, 2021

I think the best way is add transfer_all to https://github.com/open-web3-stack/open-runtime-module-library/blob/master/traits/src/currency.rs and use it in orml-currencies

Also update the tests to check the case when user have some locked token.

@mzxyz
Copy link
Author

mzxyz commented Feb 23, 2021

I think the best way is add transfer_all to https://github.com/open-web3-stack/open-runtime-module-library/blob/master/traits/src/currency.rs and use it in orml-currencies

Also update the tests to check the case when user have some locked token.

Make sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants