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

add support GetMultipleKeys #248

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Conversation

pfi79
Copy link
Contributor

@pfi79 pfi79 commented Feb 5, 2025

@pfi79 pfi79 requested a review from a team as a code owner February 5, 2025 21:43
Comment on lines 81 to 84
message GetStateMiltiple {
repeated string keys = 1;
string collection = 2;
}
Copy link
Member

Choose a reason for hiding this comment

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

Should this be GetStateMultiple? Could it use a repeated GetState field, or is there a limitation that all the reads need to be from the same collection?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ledger fabric already has an implementation of these functions. So I decided to replicate them as close to the implementation as possible. And it is implemented only for one collection.

https://github.com/hyperledger/fabric/blob/main/core/ledger/ledger_interface.go#L257

https://github.com/hyperledger/fabric/blob/main/core/ledger/ledger_interface.go#L283

Signed-off-by: Fedor Partanskiy <fredprtnsk@gmail.com>
@pfi79 pfi79 force-pushed the get-multiple-keys branch from 877e0d7 to 8864af8 Compare February 6, 2025 10:09
@denyeart
Copy link
Contributor

denyeart commented Feb 6, 2025

Do you want to include PutStateMultiple in the same PR? I always viewed them as a pair.

@pfi79
Copy link
Contributor Author

pfi79 commented Feb 6, 2025

Do you want to include PutStateMultiple in the same PR? I always viewed them as a pair.

No, because we already have WriteBatch, which fully covers the PutStateMultiple functionality, and is more universal.

@denyeart
Copy link
Contributor

denyeart commented Feb 6, 2025

Do you want to include PutStateMultiple in the same PR? I always viewed them as a pair.

No, because we already have WriteBatch, which fully covers the PutStateMultiple functionality, and is more universal.

Ah right

@denyeart
Copy link
Contributor

denyeart commented Feb 6, 2025

@pfi79 Shall I proceed with merge and a release?

Question, once Fabric has both the new features implemented, shall we proceed with a Fabric v3.1.0 release?

@pfi79
Copy link
Contributor Author

pfi79 commented Feb 6, 2025

Shall I proceed with merge and a release?

Yeah, I think it can be infused and tag released already.

@pfi79
Copy link
Contributor Author

pfi79 commented Feb 6, 2025

Question, once Fabric has both the new features implemented, shall we proceed with a Fabric v3.1.0 release?

I think it's a good idea.

I have the code all ready to go, but it needs to be taken carefully. Otherwise, there will be, as in this pr, a typo discovered (thanks @bestbeforetoday for discovering it)

@denyeart denyeart merged commit 7d5570d into hyperledger:main Feb 6, 2025
20 checks passed
@pfi79 pfi79 deleted the get-multiple-keys branch February 6, 2025 16:51
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.

3 participants