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

refactor(auth): use collections for GlobalAccountNumber #15830

Merged
merged 14 commits into from
Apr 17, 2023

Conversation

testinginprod
Copy link
Contributor

@testinginprod testinginprod commented Apr 13, 2023

Description

Closes: #15831


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@@ -6,7 +6,7 @@ import (
)

// DefaultSequenceStart defines the default starting number of a sequence.
const DefaultSequenceStart uint64 = 1
const DefaultSequenceStart uint64 = 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified this to make it match the account number semantics, which start from zero.

func MockStore() (store.KVStoreService, context.Context) {
// They can be used to test collections. The StoreService.NewStoreContext
// can be used to instantiate a new empty KVStore.
func MockStore() (*StoreService, context.Context) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes here allow the MockStore to properly match the design of the KVStoreService.

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK. not sure if we need a changelog, did we do it for params

@testinginprod testinginprod added this pull request to the merge queue Apr 14, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 14, 2023
x/auth/module.go Outdated
@@ -151,6 +151,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
if err := cfg.RegisterMigration(types.ModuleName, 4, func(ctx sdk.Context) error { return nil }); err != nil {
panic(fmt.Sprintf("failed to migrate x/%s from version 4 to 5: %v", types.ModuleName, err))
}

if err := cfg.RegisterMigration(types.ModuleName, 5, m.Migrate5to6); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually migration 4 to 5, as migration 4 was for v0.47. You can as well delete the placeholder for migration to 5, which wasn't necessary (#14483 (comment))

@julienrbrt julienrbrt mentioned this pull request Apr 14, 2023
19 tasks
x/auth/module.go Outdated Show resolved Hide resolved
x/auth/module.go Outdated Show resolved Hide resolved
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@testinginprod testinginprod added this pull request to the merge queue Apr 17, 2023
Merged via the queue into main with commit 73c8064 Apr 17, 2023
@testinginprod testinginprod deleted the tip/coll/auth_sequence branch April 17, 2023 08:59
cool-develope pushed a commit that referenced this pull request Apr 26, 2023
Co-authored-by: testinginprod <testinginprod@somewhere.idk>
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
Co-authored-by: testinginprod <testinginprod@somewhere.idk>
@testinginprod testinginprod mentioned this pull request May 26, 2023
62 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor(auth): use collections for the global account number
4 participants