Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Actually respect locks of zero #14144

Merged
merged 6 commits into from
May 23, 2023
Merged

Actually respect locks of zero #14144

merged 6 commits into from
May 23, 2023

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented May 15, 2023

When using set_lock to lock zero funds, it should not be a no-op (unlike extend_lock, in which it is).

@gavofyork gavofyork requested a review from a team May 15, 2023 12:10
@gavofyork gavofyork added A0-please_review Pull request needs code review. C3-medium PR touches the given topic and has a medium impact on builders. D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited B1-note_worthy Changes should be noted in the release notes labels May 15, 2023
@gavofyork gavofyork changed the title Actually thaw when locking zero Actually respect locks of zero May 15, 2023
@gavofyork gavofyork added the T1-runtime This PR/Issue is related to the topic “runtime”. label May 15, 2023
@KiChjang
Copy link
Contributor

What happens then when set_lock has a 0 amount? Does it function like remove_lock?

@gavofyork
Copy link
Member Author

What happens then when set_lock has a 0 amount? Does it function like remove_lock?

Any previous lock should no longer constrain the balance liquidity, similar to if remove_lock is called. However, it is not specified whether any storage on chain is reclaimed, as it is with remove_lock. In the fungible API, set_freeze(0) is explicitly defined as being equivalent to thaw().

@gavofyork
Copy link
Member Author

bot rebase

@paritytech-processbot
Copy link

Rebased

@gavofyork
Copy link
Member Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit bc3ce83 into master May 23, 2023
@paritytech-processbot paritytech-processbot bot deleted the gav-fix-currency branch May 23, 2023 08:47
@xlc
Copy link
Contributor

xlc commented May 23, 2023

someone needs to write some tests for this

gpestana pushed a commit that referenced this pull request May 27, 2023
* Actually thaw when locking zero.

* Fixes

* Just remove the lock if semantically viable

---------

Co-authored-by: parity-processbot <>
@louismerlin louismerlin removed the D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited label Jun 1, 2023
@louismerlin louismerlin added the D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited label Jun 1, 2023
Ank4n pushed a commit that referenced this pull request Jul 8, 2023
* Actually thaw when locking zero.

* Fixes

* Just remove the lock if semantically viable

---------

Co-authored-by: parity-processbot <>
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* Actually thaw when locking zero.

* Fixes

* Just remove the lock if semantically viable

---------

Co-authored-by: parity-processbot <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B1-note_worthy Changes should be noted in the release notes C3-medium PR touches the given topic and has a medium impact on builders. D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited T1-runtime This PR/Issue is related to the topic “runtime”.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

8 participants