This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Use can_hold instead of can_reserve in fn hold #12004
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
408ede3
Use can_hold instead of can_reserve in fn hold
KiChjang 462a9de
Add tests for fungible::hold
KiChjang 8be79c2
Merge remote-tracking branch 'origin/master' into kckyeung/fix-fungib…
KiChjang 13d2261
cargo fmt
KiChjang 7a6db84
Add keep_alive parameter to can_hold
KiChjang f41bd2a
Merge remote-tracking branch 'origin/master' into kckyeung/fix-fungib…
KiChjang 3730f24
Merge remote-tracking branch 'origin/master' into kckyeung/fix-fungib…
9420645
Revert "Add keep_alive parameter to can_hold"
ruseinov 17e226b
Make sure `ReservableCurrency::can_reserve` takes `ExistentialDeposit…
ruseinov 5153396
Enforce within .
ruseinov b41b36b
fix reserve
ruseinov 7916a0a
fix tests
ruseinov b58674d
fix bench
ruseinov 84e648c
fix assets tests
ruseinov 8b50397
fix asset bench
ruseinov 37ab667
add a clarification
ruseinov 6b7da31
fix benches
ruseinov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, after writing unit tests, I found out that there is a difference between
can_reserve
andcan_hold
: the latter ensures that the reserved/held amount doesn't make the free balance go below the existential deposit. Should we still continue usingcan_hold
here then? Or should we changecan_hold
to match the semantics ofcan_reserve
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we change
can_hold
what that mess up any existing code usingcan_hold
/ what are the tradeoffs?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want people to be able to use fungible traits instead of
Currency
in the future. See #8285 and #8453. We currently useCurrency
traits everywhere, and we'd like to change that.