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

chore: Rename ResetAllLocks #1951

Merged
merged 1 commit into from
Jul 4, 2022
Merged

chore: Rename ResetAllLocks #1951

merged 1 commit into from
Jul 4, 2022

Conversation

mattverse
Copy link
Member

@mattverse mattverse commented Jul 4, 2022

Closes: #1275

Sub-component of #1838

What is the purpose of the change

The method ResetAllLocks implies resetting a state, which implies we're deleting an existing state, and setting a new value for the state. This method name is misleading, as this method is not resetting an existing state, it's simply initializing a state, as ResetAllLocks are used in InitGenesis.

This PR includes renaming ResetAllLocks to InitializeAllLocks.

This PR also includes renaming setLockAndResetLockRefs to setLockAndAddLockRefs, as the intention of the method is not to delete and add lock refs, but simply add lock refs.

Brief Changelog

  • Rename ResetAllLocks to InitializeAllLocks, rename setLockAndResetLockRefs to setLockAndAddLockRefs

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? no
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? no
  • How is the feature or change documented? not documented

@mattverse mattverse requested a review from a team July 4, 2022 09:07
@mattverse mattverse mentioned this pull request Jul 4, 2022
7 tasks
@ValarDragon
Copy link
Member

Nice improvement!

@ValarDragon ValarDragon merged commit 1517e65 into main Jul 4, 2022
@ValarDragon ValarDragon deleted the mattverse/lock-refs branch July 4, 2022 16:46
@mattverse mattverse added the A:backport/v10.x backport patches to v10.x branch label Jul 12, 2022
mergify bot pushed a commit that referenced this pull request Jul 12, 2022
(cherry picked from commit 1517e65)

# Conflicts:
#	x/lockup/keeper/bench_test.go
mattverse added a commit that referenced this pull request Jul 12, 2022
* refactor ref method (#1951)

(cherry picked from commit 1517e65)

# Conflicts:
#	x/lockup/keeper/bench_test.go

* Fix merge conflict

Co-authored-by: Matt, Park <[email protected]>
Co-authored-by: mattverse <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v10.x backport patches to v10.x branch C:x/lockup
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

x/lock: Investigate setLockAndResetLockRefs
2 participants