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

feat: add index by id for storage module #80

Merged
merged 6 commits into from
Feb 28, 2023
Merged

Conversation

fynnss
Copy link
Contributor

@fynnss fynnss commented Feb 27, 2023

Description

add index bucket/object/group by id for storage module

Changes

Notable changes:

  • Refactor the storage module functions
  • Support index by id

@fynnss fynnss force-pushed the support_index_by_id branch from 7c451df to 6701c0e Compare February 27, 2023 11:29
@fynnss fynnss force-pushed the support_index_by_id branch from 6701c0e to faa3a90 Compare February 27, 2023 11:56
@@ -6,6 +6,21 @@ import (
"github.com/bnb-chain/greenfield/x/sp/types"
)

func (k Keeper) CheckIfValidStorageProvider(ctx sdk.Context, addr sdk.AccAddress) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should CheckIsValidStorageProvider better

Copy link
Contributor Author

@fynnss fynnss Feb 28, 2023

Choose a reason for hiding this comment

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

how about IsStorageProviderExistAndInService?

}); err != nil {
return nil, err
}
_ = id
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's this for

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexgao001 will impl this.

@fynnss fynnss force-pushed the support_index_by_id branch from 766c0e7 to c31eea0 Compare February 27, 2023 12:10
@fynnss fynnss force-pushed the support_index_by_id branch from c31eea0 to 995c635 Compare February 27, 2023 12:18
@fynnss fynnss force-pushed the support_index_by_id branch from e1d36ce to b3614af Compare February 28, 2023 02:35
go.mod Outdated Show resolved Hide resolved
}

sp := types.MustUnmarshalStorageProvider(k.cdc, value)
if sp.Status != types.STATUS_IN_SERVICE {
Copy link
Collaborator

Choose a reason for hiding this comment

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

CheckIfValidStorageProvider seems the validator must be in service, any way to reflect this in the name of this function to make it more readable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how about IsStorageProviderExistAndInService?

@unclezoro
Copy link
Collaborator

unclezoro commented Feb 28, 2023

I did not dive into the details of this PR, will do a thorough review of the refactor PR.

Please fix the e2e case.

LGTM

@fynnss
Copy link
Contributor Author

fynnss commented Feb 28, 2023

I did not dive into the details of this PR, will do a thorough review of the refactor PR.

Please fix the e2e case.

LGTM

Thinks. E2e test case has been fixed. Please help review again.

@fynnss fynnss added the r4r label Feb 28, 2023
@fynnss fynnss force-pushed the support_index_by_id branch from 537612f to ec16a00 Compare February 28, 2023 11:48
@unclezoro unclezoro merged commit 56f5203 into develop Feb 28, 2023
@unclezoro unclezoro deleted the support_index_by_id branch April 18, 2023 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants