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 new query APIs #399

Merged
merged 3 commits into from
Aug 3, 2023
Merged

Conversation

pythonberg1997
Copy link
Contributor

Description

This pr is to add some new query APIs for group and group member.

Changes

Notable changes:

  • add new query APIs for group and group member

}

message QueryGroupMembersExistResponse {
repeated bool are_members = 1;

Choose a reason for hiding this comment

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

I think it is better not only boolean, but response the accordingly accounts as well.


message QueryGroupsExistRequest {
repeated string group_names = 1;
repeated string group_owners = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];

Choose a reason for hiding this comment

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

group_owners is not repeated I think


// Queries whether some groups are exist.
rpc QueryGroupsExist(QueryGroupsExistRequest) returns (QueryGroupsExistResponse) {
option (google.api.http).get = "/greenfield/storage/groups_exist/{group_names}/{group_owners}";
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Query multiple groups under one user at once
  • Query multiple groups under multiple users at once

Shall we use a more generic ways to support?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To keep things simple, I think we'd better only support Query multiple groups under one user at once.

repeated string group_ids = 1;
}

message QueryGroupsExistResponse {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we unify the name of the API? E,g. HeadGroup, HeadGroups, HeadGroupById, HeadGroupsByIds, HeadGroupMember, HeanGroupMemebers

Copy link
Contributor Author

@pythonberg1997 pythonberg1997 Jul 31, 2023

Choose a reason for hiding this comment

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

The methods you mentioned are all existed. These new APIs are just used to query if the object exists

@unclezoro unclezoro added this pull request to the merge queue Aug 3, 2023
Merged via the queue into bnb-chain:develop with commit 2d96918 Aug 3, 2023
5 checks passed
@pythonberg1997 pythonberg1997 deleted the new_apis branch August 9, 2023 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants