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] Add implementation for transaction statuses data providers #6818

Open
wants to merge 82 commits into
base: master
Choose a base branch
from

Conversation

AndriiDiachuk
Copy link
Contributor

Closes: #6586

In this PR TransactionStatusesDataProvider was implemented.

New functionality was covered with tests.

Guitarheroua and others added 30 commits November 19, 2024 13:42
…:The-K-R-O-K/flow-go into AndriiDiachuk/6588-events-data-provider
…:The-K-R-O-K/flow-go into AndriiDiachuk/6588-events-data-provider
…:The-K-R-O-K/flow-go into AndriiDiachuk/6588-events-data-provider
…:The-K-R-O-K/flow-go into AndriiDiachuk/6588-events-data-provider
…The-K-R-O-K/flow-go into AndriiDiachuk/6587-accounts-data-provider
…The-K-R-O-K/flow-go into AndriiDiachuk/6587-accounts-data-provider
…:The-K-R-O-K/flow-go into AndriiDiachuk/6588-events-data-provider
…:The-K-R-O-K/flow-go into AndriiDiachuk/6588-events-data-provider
@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 69.71429% with 159 lines in your changes missing coverage. Please review.

Project coverage is 41.06%. Comparing base (61a0b0e) to head (a7a6f76).

Files with missing lines Patch % Lines
access/mock/api.go 0.00% 44 Missing ⚠️
.../rest/websockets/data_providers/events_provider.go 73.94% 22 Missing and 9 partials ⚠️
.../access/rpc/backend/backend_stream_transactions.go 59.15% 24 Missing and 5 partials ⚠️
...ockets/data_providers/account_statuses_provider.go 76.78% 18 Missing and 8 partials ⚠️
...ts/data_providers/transaction_statuses_provider.go 85.86% 9 Missing and 4 partials ⚠️
.../rest/websockets/data_providers/blocks_provider.go 52.63% 6 Missing and 3 partials ⚠️
cmd/util/cmd/run-script/cmd.go 0.00% 6 Missing ⚠️
access/handler.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6818      +/-   ##
==========================================
+ Coverage   40.96%   41.06%   +0.09%     
==========================================
  Files        2093     2097       +4     
  Lines      184478   184956     +478     
==========================================
+ Hits        75577    75950     +373     
- Misses     102579   102633      +54     
- Partials     6322     6373      +51     
Flag Coverage Δ
unittests 41.06% <69.71%> (+0.09%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AndriiDiachuk AndriiDiachuk removed the request for review from peterargue December 17, 2024 12:59
s.Require().NotNil(s.factory)
}

func (s *TransactionStatusesProviderSuite) TestTransactionStatusesDataProvider_HappyPath() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add godoc here

serverAPI,
chain,
stateStreamConfig.EventFilterConfig,
stateStreamConfig.HeartbeatInterval)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
stateStreamConfig.HeartbeatInterval)
stateStreamConfig.HeartbeatInterval,
)

StartBlockHeight uint64 // Height of the block to start subscription from
}

type TransactionStatusesDataProvider struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add please a few words (godoc) for this provider?

// handleResponse processes an account statuses and sends the formatted response.
//
// No errors are expected during normal operations.
func (p *TransactionStatusesDataProvider) handleResponse() func(txResults []*access.TransactionResult) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use generic HandleResponse from subscription in Run() and get rid of handleResponse()?

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.

[Access] Add implementation for transaction status data providers
5 participants