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

disambiguate success responses with enum status #239

Open
ralexstokes opened this issue Sep 5, 2022 · 1 comment
Open

disambiguate success responses with enum status #239

ralexstokes opened this issue Sep 5, 2022 · 1 comment
Labels
beacon-api-client enhancement New feature or request help wanted Extra attention is needed

Comments

@ralexstokes
Copy link
Owner

some of the beacon APIs return different status codes in the 2XX range to indicate different notions of success

e.g. https://ethereum.github.io/beacon-APIs/#/Beacon/publishBlock

200: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database.
202: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database.

it would be nice to disambiguate these cases when it exists

for example, the code calling this API could return something more expressive than a () like:

pub enum BlockBroadcastStatus {
    ValidatedAndBroadcast,
    ValidationFailureAndBroadcast,
}
@ralexstokes
Copy link
Owner Author

and there may be other endpoints that do this type of thing where we can add more information about various 2XX status code responses

@ralexstokes ralexstokes added enhancement New feature or request help wanted Extra attention is needed labels Jul 7, 2023
@ralexstokes ralexstokes transferred this issue from ralexstokes/beacon-api-client Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beacon-api-client enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant