-
Notifications
You must be signed in to change notification settings - Fork 64
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
Type IPricesApi
/IBalancesApi
responses as "raw"
#2100
base: main
Are you sure you want to change the base?
Conversation
IPricesApi
responses as "raw"IPricesApi
/IBalancesApi
responses as "raw"
}); | ||
|
||
expect(networkService.get.mock.calls.length).toBe(4); | ||
expect(networkService.get.mock.calls.length).toBe(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will be addressed by adjusting the HttpErrorFactory
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, and I'm pretty sure you are aware, but just something to have in mind: I'd say we need to be cautious there and avoid exposing the details of a ZodError when the validation failure comes from an error while processing a Datasource response (e.g.: a Transaction Service response), to avoid leaking data through the public route controller 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree with you!
af62ce5
to
fc3d64b
Compare
Partial implementation of #1731
Summary
We validate API responses on the domain layer, but directly assign the type in the datasources. This means that the response types are not necessarily correct.
This types all request responses of
IPricesApi
/IBalancesApi
as "raw". These responses are therefore not be used directly unless they are validated.Not: these are combined as they are heavily interlinked.
Changes
Raw
utility type toIStakingApi
Raw
utility type toIBalancesApi