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

[Access] Added collection_id and block_id to GetTransactionResult arguments #4263

Conversation

Guitarheroua
Copy link
Collaborator

#2099

Context

This pull request adds two new optional arguments to GetTransactionResult: collection_id and block_id. These arguments will help avoid duplicate transaction hashes. If both arguments are missing, the default lookup by transaction ID is performed. The block ID lookup has the highest priority, followed by the collection ID lookup if they are passed. This change ensures backward compatibility with previous versions of the code.

As part of this PR:

The protobuf and Open API were extended(onflow/flow#1335)

Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

Thanks @Guitarheroua! It could use some more input validation but it's pretty close.

access/handler.go Outdated Show resolved Hide resolved
engine/access/rest/transactions_test.go Outdated Show resolved Hide resolved
engine/access/rpc/backend/backend_transactions.go Outdated Show resolved Hide resolved
engine/access/rpc/backend/backend_transactions.go Outdated Show resolved Hide resolved
engine/access/rpc/backend/backend_transactions.go Outdated Show resolved Hide resolved
Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

Thanks for making those changes. A few more comments, but it's very close.

engine/access/rpc/backend/backend_transactions.go Outdated Show resolved Hide resolved
engine/access/rpc/backend/backend_transactions.go Outdated Show resolved Hide resolved
engine/access/rpc/backend/backend_transactions.go Outdated Show resolved Hide resolved
go.mod Outdated
@@ -278,3 +278,5 @@ require (
lukechampine.com/blake3 v1.1.7 // indirect
nhooyr.io/websocket v1.8.6 // indirect
)

replace github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20230330183547-d0dd18f6f20d => github.com/Guitarheroua/flow/protobuf/go/flow v0.0.0-20230419235211-f2ad63b590cf
Copy link
Contributor

Choose a reason for hiding this comment

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

don't forget to update back to onflow/flow

engine/access/access_test.go Outdated Show resolved Hide resolved
engine/access/access_test.go Show resolved Hide resolved
Guitarheroua and others added 2 commits April 28, 2023 14:14
Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com>
Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

Looks good once the conflicts are addressed and the imports is switched back to onflow/flow

Copy link
Contributor

@koko1123 koko1123 left a comment

Choose a reason for hiding this comment

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

looks good to me! aside from the dependency change in go.mod

@Guitarheroua
Copy link
Collaborator Author

looks good to me! aside from the dependency change in go.mod

@peterargue @koko1123 This one will be blocked if 1335 will not be reviewed. I do not know who is responsible for this repo to review.

@peterargue
Copy link
Contributor

looks good to me! aside from the dependency change in go.mod

@peterargue @koko1123 This one will be blocked if 1335 will not be reviewed. I do not know who is responsible for this repo to review.

ah, sorry. I missed that one. Just approved. I'll work on getting it merged

@peterargue
Copy link
Contributor

@Guitarheroua the protobuf changes were just merged

@codecov-commenter
Copy link

Codecov Report

Merging #4263 (1d6bce2) into master (3e35791) will decrease coverage by 10.37%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master    #4263       +/-   ##
===========================================
- Coverage   53.66%   43.30%   -10.37%     
===========================================
  Files         860       14      -846     
  Lines       80029      709    -79320     
===========================================
- Hits        42950      307    -42643     
+ Misses      33684      359    -33325     
+ Partials     3395       43     -3352     
Flag Coverage Δ
unittests 43.30% <ø> (-10.37%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 846 files with indirect coverage changes

@Guitarheroua
Copy link
Collaborator Author

bors merge

@bors
Copy link
Contributor

bors bot commented May 1, 2023

🔒 Permission denied

Existing reviewers: click here to make Guitarheroua a reviewer

@durkmurder
Copy link
Member

bors merge

@bors bors bot merged commit e01ef0a into onflow:master May 1, 2023
@Guitarheroua Guitarheroua deleted the guitarheroua/2099-add-collectionid-and-block-id branch June 12, 2023 18:26
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.

5 participants