-
Notifications
You must be signed in to change notification settings - Fork 214
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
[ADP-3359] Report unaccepted-era transactions as HTTP 403 errors #4595
[ADP-3359] Report unaccepted-era transactions as HTTP 403 errors #4595
Conversation
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.
When adding UnsupportedEraInTxSubmission
you need to add its counterparts in swagger, so something like :
x-errUnsupportedEraInTxSubmission: &errUnsupportedEraInTxSubmission
<<: *responsesErr
title: unsupported_era_in_tx_submission
properties: message:
type: string
description: |
Happens when transaction was constructed before Babbage era
code:
type: string
enum: ['unsupported_era_in_tx_submission']
And insert errUnsupportedEraInTxSubmission
under proper submit endpoint in 403 hierarchy.
Without it unit test will fail as there is no correspondence between ApiError and swagger errors.
Also, what about adding integration test with Alonzo tx as a cbor and showing that the endpoint endup with 403 and proper error msg?
2d69876
to
638da7f
Compare
638da7f
to
345f905
Compare
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.
Hi @paolino
Many thanks for making this PR.
I've left some suggestions (and one small request)!
345f905
to
bf3471a
Compare
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.
LGTM!
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.
nice! I have added integration tests showing that your changes handle tx constructed in previous eras as it is expected .
…s. (#4603) This PR: - adds a new constant `recentEras :: Set AnyRecentEra` - this constant defines the complete set of **_recent eras_** that are supported for transaction construction. - uses this constant to simplify the construction of the following API errors: - `ApiErrorNodeNotYetInRecentEra` - `ApiErrorUnsupportedEra` ## Issue ADP-3359 Follow-on from #4595.
…e. (#4605) This PR moves the `ApiEra` type and related functions to a separate module `Api.Types.Era`. As a result: - the `ApiEra` type is co-located only with its related functions; - the `Api.Types` [megamodule](https://www.parsonsmatt.org/2019/11/27/keeping_compilation_fast.html) is now ever-so-slightly smaller. Additionally: - functions relating to `ApiEra` are now imported via the `ApiEra` qualifier; - the `Api.Types` module does **_not_** re-export symbols from `Api.Types.Era`. ## Issue ADP-3359 Follow-on from #4595.
error
call when not-in-a-recent-era tx is postedADP-3359