Skip to content

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.

2 participants