Closed jerryfan01234 closed 2 weeks ago
The changes introduce a migration function for the accountplus
module's AccountState
, transitioning from non-prefixed to prefixed keys in a key-value store. The updates include new methods in the keeper
to facilitate access to store keys and enhance data retrieval. A new test suite for verifying the migration process is also added, alongside modifications to existing functions and tests to ensure consistency and correctness in account state management.
File Path | Change Summary |
---|---|
protocol/app/upgrades/v8.0/upgrade.go |
Added migration function migrateAccountplusAccountState for transitioning AccountState to prefixed keys. |
protocol/x/accountplus/keeper/keeper.go |
Added methods GetStoreKey() and GetCdc() , refactored GetAllAccountStates , updated GetAccountState and SetAccountState to use prefix store, renamed GetAccountPlusStateWithTimestampNonceDetails to AccountStateFromTimestampNonceDetails . |
protocol/x/accountplus/keeper/keeper_test.go |
Introduced TestKeeper_Set_Get_GetAllAccountState to test setting, getting, and retrieving account states. |
protocol/x/accountplus/keeper/timestampnonce.go |
Updated ProcessTimestampNonce to use renamed function, refactored EjectStaleTimestampNonces for clarity, simplified isLargerThanSmallestValue . |
protocol/x/accountplus/types/keys.go |
Added constant AccountStateKeyPrefix for account state keys. |
protocol/app/upgrades/v8.0/migrate_accountplus_test.go |
Introduced test suite UpgradeTestSuite to test migration of account states, including setup and validation methods. |
accountplus
module may relate to the migration function for AccountState
as it establishes foundational structures for account management.accountplus
module includes updates to account state management, which aligns with the migration of AccountState
to prefixed keys.accountplus
directly relate to the migration of account states, as they ensure that the initial state is correctly set up after migration.proto
, feature:timestamp_nonce
🐰 In the meadow, we hop and play,
With account states, we pave the way.
From old to new, we make the shift,
With prefixes now, our data's a gift!
Migration's done, let’s cheer and sing,
For every change, a joyful spring! 🌼
Changelist
[Describe or list the changes made in this PR]
Test Plan
[Describe how this PR was tested (if applicable)]
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests