[Assets] Implement pallet-assets-holder#4530
Conversation
…nce based on whether there's held assets or not
c627c51 to
89ea43a
Compare
…th the tokens' _balance components_ model. On the most recent documentation about tokens (both _fungible_ and _fungibles_ (sets)), the model for calculating the different balance components is explained. The prior implementation of `pallet-assets` featured a weird definition of how to handle them that was not in line with the expected (see <https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/fungible/index.html#holds-and-freezes>) definition of tokens. This commit changes this implementation for methods `reducible_balance` and `can_decrease` to introduce the calculation of `spendable` balance, and the consequences derived of decreasing a balance that may include both `frozen` and `held` balances.
… working together
|
@joepetrowski @muharem can you please take a look at this and if we need this? |
muharem
left a comment
There was a problem hiding this comment.
@pandres95 I do not really understand the plan. I see only first step in the issue. also are you sure we need this new trait? can we do the same with fungibles traits? I see that we have a similar FrozenBalance trait, but it probably was introduced before the fungibles was. can we bring the hold implementation with a single PR? it would make it more clear and we get it faster. this PR wont bring anything useful, only breaking changes.
|
Sure! Can complete the second step in the same PR. The reason behind this trait is that in some prior meeting Gav advised against exhaustively modifying some core pallets like |
|
@pandres95 yes, it should be done as an extension. there is also a |
HeldBalancepallet-assets-holder
|
@muharem the pallet implementation is done and ready to review |
Closes paritytech#4315 --------- Co-authored-by: Guillaume Thiolliere <guillaume.thiolliere@parity.io>
Closes paritytech#4315 --------- Co-authored-by: Guillaume Thiolliere <guillaume.thiolliere@parity.io>
Closes paritytech#4315 --------- Co-authored-by: Guillaume Thiolliere <guillaume.thiolliere@parity.io>
Closes paritytech#4315 --------- Co-authored-by: Guillaume Thiolliere <guillaume.thiolliere@parity.io>
Closes #4315