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] Make response for data providers consistent. #6846

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

Conversation

AndriiDiachuk
Copy link
Contributor

Closes: #6819

@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.18%. Comparing base (72adf9e) to head (4c3e5ae).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6846   +/-   ##
=======================================
  Coverage   41.18%   41.18%           
=======================================
  Files        2109     2109           
  Lines      185660   185689   +29     
=======================================
+ Hits        76460    76476   +16     
- Misses     102788   102795    +7     
- Partials     6412     6418    +6     
Flag Coverage Δ
unittests 41.18% <100.00%> (+<0.01%) ⬆️

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.

Height: strconv.FormatUint(accountStatusesResponse.Height, 10),
AccountEvents: accountStatusesResponse.AccountEvents,
MessageIndex: index,
p.send <- &models.BaseDataProvidersResponse{
Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding a common function or method Build for BaseDataProvidersResponse that creates/fills BaseDataProvidersResponse and is used by every provider? Also I guess, we can use baseDataProvider as an argument to fill SubscriptionID and Topic. This approach would help avoid code duplication in the providers. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

This PR should be merged after #6802 and use response.Build functionality for Payload field


require.Equal(s.T(), expectedAccountStatusesResponse.BlockID.String(), actualResponse.BlockID)
require.Equal(s.T(), len(expectedAccountStatusesResponse.AccountEvents), len(actualResponse.AccountEvents))
actualResponseData, ok := actualResponse.Payload.(*models.AccountStatusesResponse)
Copy link
Contributor

@UlyanaAndrukhiv UlyanaAndrukhiv Jan 3, 2025

Choose a reason for hiding this comment

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

nit: I think we should also check the Topic here and in other tests if we added it to the response.

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] Make response for data providers consistent with action responses
4 participants